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 17
17
- Allow empty inline records in variants. https://github.com/rescript-lang/rescript-compiler/pull/6494
18
18
- Allow empty record patterns in pattern matching. https://github.com/rescript-lang/rescript-compiler/pull/6494
19
19
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
+
20
23
# 11.0.0-rc.6
21
24
22
25
#### :rocket : New Feature
Original file line number Diff line number Diff line change @@ -4675,12 +4675,15 @@ and parseConstrDeclArgs p =
4675
4675
let attrs =
4676
4676
if optional then optionalAttr :: attrs else attrs
4677
4677
in
4678
- Parser. expect Comma p;
4679
4678
{field with Parsetree. pld_attributes = attrs}
4680
4679
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)
4684
4687
in
4685
4688
Parser. expect Rbrace p;
4686
4689
Parser. optional p Comma |> ignore;
Original file line number Diff line number Diff line change @@ -42,4 +42,7 @@ type nonrec multipleWithAttrs = {
42
42
x: int ;
43
43
y: string [@res.optional ][@attr ]}
44
44
type 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}
49
49
50
50
type multipleWithAttrs = {x :int , @attr y ?: string }
51
51
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