From: Siraaj Khandkar Date: Mon, 28 May 2018 17:47:25 +0000 (-0400) Subject: Remove stand-alone fun_call grammar rule X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=commitdiff_plain;h=29de275c04959d47f3a8b03443e7d9b48853daeb Remove stand-alone fun_call grammar rule --- 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 {