The unified diff between revisions [9a6e8df1..] and [879bb490..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/lsc/parser.y'
# # old_revision [9a6e8df1d6b102f467702e274d53d90f9151e2c8] # new_revision [879bb490162f7bfef0afc9c96666267f54996591] # # patch "src/lsc/parser.y" # from [a3d3372576329c2dc4221d54c0a05238eb86dece] # to [2e92a218e99f7522cbd4a48694ec2202d575e0d2] # ============================================================ --- src/lsc/parser.y a3d3372576329c2dc4221d54c0a05238eb86dece +++ src/lsc/parser.y 2e92a218e99f7522cbd4a48694ec2202d575e0d2 @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) %} -%token TOKFUNCTION TOKFNDEFINT TOKFNDEFEXT TOKCONSTANT +%token TOKFUNCTION TOKFNDEFINT TOKFNDEFINT_V TOKFNDEFEXT TOKCONSTANT %token TOKWHILE TOKIF TOKELSE TOKSWITCH TOKCASE TOKDEFAULT %token TOKBREAK TOKRETURN TOKEQ TOKNE TOKAND TOKOR STRING @@ -86,6 +86,7 @@ int main(int argc, char *argv[]) %type <Tast> fndefint %type <Tast> fndefext %type <Tast> statement +%type <Tast> fndefint_v %type <Tast> assignment %type <Tast> expression %type <Tast> realconstant @@ -142,6 +143,7 @@ fn_list_inner: fn_list_inner: fn_list_inner function { $$ = make_list($2, $1); } | fn_list_inner fndefint { $$ = make_list($2, $1); } + | fn_list_inner fndefint_v { $$ = make_list($2, $1); } | fn_list_inner fndefext { $$ = make_list($2, $1); } | fn_list_inner constant { $$ = make_list($2, $1); } | fn_list_inner realconstant { $$ = make_list($2, $1); } @@ -158,6 +160,11 @@ fndefint: { $$ = make_fndefint($2, $3); } ; +fndefint_v: + TOKFNDEFINT_V IDENTIFIER NUMBER ';' + { $$ = make_fndefint_v($2, $3); } + ; + constant: TOKCONSTANT IDENTIFIER NUMBER ';' { $$ = make_constant($2, $3); } @@ -319,8 +326,11 @@ statement_return: ; statement_return: + TOKRETURN expression + { $$ = make_return_statement($2); } + | TOKRETURN - { $$ = make_return_statement(); } + { $$ = make_return_statement(NULL); } ; statement_break: