Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After REPI and WHILEI, the loop variable contains the number of itera…
…tions. As pointed out by Per Austrin, the value of the loop variable after the loop was undefined. Define it to be the number of iterations, i.e. one beyond the last iteration value. Also add a modified test case provided by Per in #7.
- Loading branch information
Showing
3 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# IGNORE GENERATE TESTING | ||
# Read exactly 2 bits (space-separated) | ||
WHILEI(i,!MATCH("\n"), SPACE) | ||
INT(0,1) | ||
END | ||
ASSERT(i==2) | ||
NEWLINE | ||
# Test an empty loop | ||
REPI(j,0) END | ||
ASSERT(j==0) |