File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed
tests/parsing/grammar/expressions Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 1717- Allow empty inline records in variants. https://github.com/rescript-lang/rescript-compiler/pull/6494
1818- Allow empty record patterns in pattern matching. https://github.com/rescript-lang/rescript-compiler/pull/6494
1919
20+ #### :bug : Bug Fix
21+ - Fix issue where an inline record with attributes did not parse. https://github.com/rescript-lang/rescript-compiler/pull/6499
22+
2023# 11.0.0-rc.6
2124
2225#### :rocket : New Feature
Original file line number Diff line number Diff line change @@ -4675,12 +4675,15 @@ and parseConstrDeclArgs p =
46754675 let attrs =
46764676 if optional then optionalAttr :: attrs else attrs
46774677 in
4678- Parser. expect Comma p;
46794678 {field with Parsetree. pld_attributes = attrs}
46804679 in
4681- first
4682- :: parseCommaDelimitedRegion ~grammar: Grammar. FieldDeclarations
4683- ~closing: Rbrace ~f: parseFieldDeclarationRegion p
4680+ if p.token = Rbrace then [first]
4681+ else (
4682+ Parser. expect Comma p;
4683+ first
4684+ :: parseCommaDelimitedRegion
4685+ ~grammar: Grammar. FieldDeclarations ~closing: Rbrace
4686+ ~f: parseFieldDeclarationRegion p)
46844687 in
46854688 Parser. expect Rbrace p;
46864689 Parser. optional p Comma |> ignore;
Original file line number Diff line number Diff line change @@ -42,4 +42,7 @@ type nonrec multipleWithAttrs = {
4242 x: int ;
4343 y: string [@res.optional ][@attr ]}
4444type nonrec singleWithAttrs = {
45- y: string [@res.optional ][@attr ]}
45+ y: string [@res.optional ][@attr ]}
46+ type nonrec inlineWithAttrs =
47+ | A of {
48+ value: string [@as {js|VALUE|js}]}
Original file line number Diff line number Diff line change @@ -49,4 +49,6 @@ type ttt = {x:int, y?: string}
4949
5050type multipleWithAttrs = {x :int , @attr y ?: string }
5151
52- type singleWithAttrs = {@attr y ?: string }
52+ type singleWithAttrs = {@attr y ?: string }
53+
54+ type inlineWithAttrs = | A ({@as ("VALUE" ) value : string })
You can’t perform that action at this time.
0 commit comments