aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--12/main.y17
1 files changed, 15 insertions, 2 deletions
diff --git a/12/main.y b/12/main.y
index 319b2d9..348890f 100644
--- a/12/main.y
+++ b/12/main.y
@@ -62,11 +62,20 @@ assignment_expr: argument ASSIGN unary_expr
62 | argument ASSIGN boolean_expr 62 | argument ASSIGN boolean_expr
63 ; 63 ;
64 64
65func_call_expr: ID LPAREN expression_list RPAREN
66 | ID LPAREN RPAREN
67 ;
68
65expression: unary_expr 69expression: unary_expr
66 | boolean_expr 70 | boolean_expr
67 | assignment_expr 71 | assignment_expr
72 | func_call_expr
68 ; 73 ;
69 74
75expression_list: expression
76 | expression COMMA expression_list
77 ;
78
70for_expr: FOR LPAREN statement statement expression RPAREN block 79for_expr: FOR LPAREN statement statement expression RPAREN block
71 | FOR LPAREN statement statement RPAREN block 80 | FOR LPAREN statement statement RPAREN block
72 ; 81 ;
@@ -86,8 +95,12 @@ block_cont: statement block_cont
86 | RBRACE 95 | RBRACE
87 ; 96 ;
88 97
89statement: RET expression ENDL 98return_stmt: RET ENDL
90 | expression ENDL 99 | RET primary_expr ENDL
100 ;
101
102statement: expression ENDL
103 | return_stmt
91 | block 104 | block
92 | for_expr 105 | for_expr
93 | if_expr 106 | if_expr