polserver/testsuite/escript/compiler2/compiler2-113-basic-for-expression-scope.src
Eric Swanson ee9ad368de
Add for loops (basic and c-style) (#287)
Adds:
- ast/BasicForLoop
- ast/CstyleForLoop
2020-09-08 01:56:30 -07:00

11 lines
275 B
Text

// We need to make sure that any references to a variable with the
// same name as the iterator refer to the _shadowed_ variable,
// not the iterator itself. Also, the iterator is
// not valid in the expression!
var a := 1;
var b := 8;
for a := a to b
print(a);
endfor