gmqcc/tests/parent_block_scope_for_locals.qc
Dale Weiler 465941f357 pass parent scope to parse_statement_or_block
previous behavior when parsing a statement where a block is typically expected would fail to associate the statement with the parent block it's in, resulting in variable declarations ending up in global scope.

this fixes #197
2021-03-02 10:46:05 -05:00

16 lines
No EOL
173 B
C++

void a() {
if (1)
for (float i = 0; i < 3; ++i)
print(ftos(i));
}
void b() {
if (1)
for (float i = 0; i < 3; ++i)
print(ftos(i));
}
void main() {
a();
b();
}