From 990ae0e3a818d63cedc9e7bd91e48c0b30ea9cc9 Mon Sep 17 00:00:00 2001 From: Sander Spies Date: Tue, 14 Apr 2020 21:15:12 +0200 Subject: [PATCH] Make it possible to pun the first argument of a record. --- src/passes/1-parser/reasonligo/Parser.mly | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/passes/1-parser/reasonligo/Parser.mly b/src/passes/1-parser/reasonligo/Parser.mly index e8dea1820..d601d858c 100644 --- a/src/passes/1-parser/reasonligo/Parser.mly +++ b/src/passes/1-parser/reasonligo/Parser.mly @@ -932,6 +932,17 @@ sequence_or_record_in: | None -> PaRecord {r_elts = ($1, []); r_terminator = None} } +| field_name more_field_assignments { + let value = { + field_name = $1; + assignment = ghost; + field_expr = EVar $1 } + in + let field_name = {$1 with value} in + let (comma, elts) = $2 in + let r_elts = Utils.nsepseq_cons field_name comma elts in + PaRecord {r_elts; r_terminator = None} +} sequence_or_record: "{" sequence_or_record_in "}" {