X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=tiger%2Fsrc%2Flib%2Ftiger%2Ftiger_parser.mly;h=4497ce30eb51bcb491467fe78e97ba796b2623bc;hb=29de275c04959d47f3a8b03443e7d9b48853daeb;hp=bbf89f7e3da54775f7b6ec4f6f5a6ca07ad24680;hpb=82e73e6c8e7a7613db98f5b229ab7665b9940b00;p=tiger.ml.git diff --git a/tiger/src/lib/tiger/tiger_parser.mly b/tiger/src/lib/tiger/tiger_parser.mly index bbf89f7..4497ce3 100644 --- a/tiger/src/lib/tiger/tiger_parser.mly +++ b/tiger/src/lib/tiger/tiger_parser.mly @@ -109,9 +109,16 @@ exp: { sprintf "string[%S]" $1 } - | fun_call + | ID unit { - $1 + let id = $1 in + sprintf "fun_call[%s, []]" id + } + | ID LPAREN fun_args RPAREN + { + let id = $1 in + let fun_args = $3 in + sprintf "fun_call[%s, %s]" id fun_args } | exp op exp { @@ -294,19 +301,6 @@ rec_field_assignments: sprintf "%S = %s, %s" id exp rec_field_assignments } -fun_call: - | ID unit - { - let id = $1 in - sprintf "fun_call[%s, []]" id - } - | ID LPAREN fun_args RPAREN - { - let id = $1 in - let fun_args = $3 in - sprintf "fun_call[%s, %s]" id fun_args - } - fun_args: | exp {