Skip to content

Commit

Permalink
Fix controlflow and one passing test
Browse files Browse the repository at this point in the history
  • Loading branch information
vivianyyd committed Oct 30, 2023
1 parent 7fdb8c9 commit 5f6750b
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ terminal COLONCOLON;

terminal PERIOD;

terminal IF, ELSE, WHILE, LOOP, BREAK;
terminal IF, ELSE, LOOP, BREAK;
terminal INPUT, FROM, OUTPUT, TO;

terminal REDUCE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ NUM = ((-)?[1-9][0-9]*) | 0
"input" { return symbol(sym.INPUT); }
"output" { return symbol(sym.OUTPUT); }

"if" { return symbol(sym.IF); }
"else" { return symbol(sym.ELSE); }
"loop" { return symbol(sym.LOOP); }
"break" { return symbol(sym.BREAK); }

/* Expressions */
"." { return symbol(sym.PERIOD); }

Expand Down
Loading

0 comments on commit 5f6750b

Please sign in to comment.