aboutsummaryrefslogtreecommitdiff
path: root/src/parser.y
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-20 21:29:50 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-20 21:29:50 +0200
commit40cccdb7cc472ee6300c25e1774a8489e9107f6a (patch)
tree7a4b0b37d8547a27b9964cd775bc0eb75d69288a /src/parser.y
parent56cd967554e39dd9053b2b28c1f603ae63808527 (diff)
downloadimp-40cccdb7cc472ee6300c25e1774a8489e9107f6a.tar.gz
imp-40cccdb7cc472ee6300c25e1774a8489e9107f6a.zip
repl
Diffstat (limited to 'src/parser.y')
-rw-r--r--src/parser.y4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/parser.y b/src/parser.y
index c1e1d0e..cb3544e 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -27,7 +27,7 @@ void yyerror(const char *s) {
%token <num> TOKEN_NUMERAL
%token TOKEN_ASSIGN
%token TOKEN_LEFT_PARENTHESIS TOKEN_RIGHT_PARENTHESIS
-%left TOKEN_SEMICOLON
+%token TOKEN_SEMICOLON
%token TOKEN_SKIP
%token TOKEN_IF TOKEN_THEN TOKEN_ELSE TOKEN_END TOKEN_WHILE TOKEN_DO TOKEN_VAR TOKEN_IN
%token TOKEN_PLUS TOKEN_MINUS TOKEN_MULTIPLY
@@ -50,8 +50,6 @@ statement : TOKEN_SKIP
{ $$ = ast_assign($1, $3); }
| TOKEN_LEFT_PARENTHESIS statement TOKEN_SEMICOLON statement TOKEN_RIGHT_PARENTHESIS
{ $$ = ast_seq($2, $4); }
- | statement TOKEN_SEMICOLON statement
- { $$ = ast_seq($1, $3); }
| TOKEN_IF boolean_expression TOKEN_THEN statement TOKEN_ELSE statement TOKEN_END
{ $$ = ast_if($2, $4, $6); }
| TOKEN_WHILE boolean_expression TOKEN_DO statement TOKEN_END