From: Siraaj Khandkar Date: Mon, 28 May 2018 18:35:23 +0000 (-0400) Subject: Move definition closer to usage location X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=b3c9d54d88ff9d02e78e79c8669bfbba77ea0590;p=tiger.ml.git Move definition closer to usage location --- diff --git a/tiger/src/lib/tiger/tiger_parser.mly b/tiger/src/lib/tiger/tiger_parser.mly index 43ec10f..fee8888 100644 --- a/tiger/src/lib/tiger/tiger_parser.mly +++ b/tiger/src/lib/tiger/tiger_parser.mly @@ -167,6 +167,21 @@ exp: "unit[]" } +rec_field_assignments: + | ID EQ exp + { + let id = $1 in + let exp = $3 in + sprintf "%S = %s" id exp + } + | ID EQ exp COMMA rec_field_assignments + { + let id = $1 in + let exp = $3 in + let rec_field_assignments = $5 in + sprintf "%S = %s, %s" id exp rec_field_assignments + } + exps: | exp { @@ -269,21 +284,6 @@ tyfields: sprintf "%s, %s" tyfield tyfields } -rec_field_assignments: - | ID EQ exp - { - let id = $1 in - let exp = $3 in - sprintf "%S = %s" id exp - } - | ID EQ exp COMMA rec_field_assignments - { - let id = $1 in - let exp = $3 in - let rec_field_assignments = $5 in - sprintf "%S = %s, %s" id exp rec_field_assignments - } - fun_args: | exp {