1 #ifndef CONTEXT_FLAGS_H 2 #define CONTEXT_FLAGS_H 3 4 // The grammar permits certain statements which are syntactically invalid, (a) because it's awkward to handle 5 // there, and (b) because we get far better control over error messages here (vs. 'syntax error'). 6 // The following flags are used as the CST is built from the AST for CST-build-time validation. 7 8 #define IN_BREAKABLE 0x00000200 // break/continue are only OK (recursively) inside for/while/do-while 9 #define IN_BEGIN_OR_END 0x00000400 // $stuff is not OK (recursively) inside begin/end 10 #define IN_FUNC_DEF 0x00000800 // locals only valid in func/subr; no srec assignments in functions 11 #define IN_SUBR_DEF 0x00001000 // locals only valid in func/subr 12 #define IN_MLR_FILTER 0x00002000 // Anywhere within mlr filter, the 'filter' keyword is invalid 13 #define IN_MLR_FINAL_FILTER 0x00004000 // mlr filter's final statement must be a bare boolean 14 #define IN_TRIPLE_FOR_CONTINUE 0x00004000 // Final statement of triple-for continuation statements must be a bare boolean 15 16 #endif // CONTEXT_FLAGS_H 17