compound_statement_3
lbrace .and statement_list .and rbrace;
-/*
- * <statement_no_new_scope> ::= <compound_statement_no_new_scope>
- * | <simple_statement>
- */
-statement_no_new_scope
- compound_statement_no_new_scope .or simple_statement;
-
/*
* <compound_statement_no_new_scope> ::= "{" "}"
* | "{" <statement_list> "}"
compound_statement_no_new_scope_3
lbrace .and statement_list .and rbrace;
+
/*
* <statement_list> ::= <statement>
* | <statement_list> <statement>
/*
* <iteration_statement> ::= "while" "(" <condition> ")" <statement>
* | "do" <statement> "while" "(" <expression> ")" ";"
- * | "for" "(" <for_init_statement> <for_rest_statement> ")"
- * <statement_no_new_scope>
+ * | "for" "(" <for_init_statement> <for_rest_statement> ")" <statement>
*/
iteration_statement
iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;
expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;
iteration_statement_3
"for" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and
- for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;
+ for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement;
/*
* <for_init_statement> ::= <expression_statement>
" lbrace .and rbrace;\n"
"compound_statement_3\n"
" lbrace .and statement_list .and rbrace;\n"
-"statement_no_new_scope\n"
-" compound_statement_no_new_scope .or simple_statement;\n"
"compound_statement_no_new_scope\n"
" compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;\n"
"compound_statement_no_new_scope_1\n"
" expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;\n"
"iteration_statement_3\n"
" \"for\" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and\n"
-" for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\n"
+" for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement;\n"
"for_init_statement\n"
" expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE;\n"
"conditionopt\n"
RETURN0;
if (!parse_child_operation(C, &o, oper, GL_FALSE))
RETURN0;
-#if 0
if (!parse_child_operation(C, &o, oper, GL_TRUE))
RETURN0;
-#else
- /* force creation of new scope for loop body */
- {
- slang_operation *ch;
- slang_output_ctx oo = o;
-
- /* grow child array */
- ch = slang_operation_grow(&oper->num_children, &oper->children);
- ch->type = SLANG_OPER_BLOCK_NEW_SCOPE;
-
- ch->locals->outer_scope = o.vars;
- oo.vars = ch->locals;
-
- if (!parse_child_operation(C, &oo, ch, GL_TRUE))
- RETURN0;
- }
-#endif
}
break;
case OP_PRECISION: