diff --git a/c/mapping/mlr_dsl_cst_statements.c b/c/mapping/mlr_dsl_cst_statements.c index 7f4e6884c..d7fbb76b2 100644 --- a/c/mapping/mlr_dsl_cst_statements.c +++ b/c/mapping/mlr_dsl_cst_statements.c @@ -345,6 +345,11 @@ mlr_dsl_cst_statement_t* mlr_dsl_cst_alloc_statement(mlr_dsl_cst_t* pcst, mlr_ds return alloc_do_while(pcst, pnode, type_inferencing, context_flags | IN_BREAKABLE); break; case MD_AST_NODE_TYPE_FOR_SREC: + if (context_flags & IN_BEGIN_OR_END) { + fprintf(stderr, "%s: statements involving $-variables are not valid within begin or end blocks.\n", + MLR_GLOBALS.bargv0); + exit(1); + } return alloc_for_srec(pcst, pnode, type_inferencing, context_flags | IN_BREAKABLE); break; case MD_AST_NODE_TYPE_FOR_OOSVAR: diff --git a/c/todo.txt b/c/todo.txt index a4139d42c..fe11af584 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -74,6 +74,8 @@ UT FOR 5.0.0: - put them *above* all local/for/UDF/etc * oosvar-single-for UT +* rtr case for $* in begin/end/func + ---------------------------------------------------------------- DOC FOR 5.0.0: