Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 0856004

Browse files
committed
Remove "optional" from parser.
1 parent 188ca8a commit 0856004

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

src/res_core.ml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,7 +2705,6 @@ and parseJsxChildren p =
27052705
and parseBracedOrRecordExpr p =
27062706
let startPos = p.Parser.startPos in
27072707
Parser.expect Lbrace p;
2708-
let attrsForFields = parseAttributesForFields p in
27092708
match p.Parser.token with
27102709
| Rbrace ->
27112710
Parser.err p (Diagnostics.unexpected Rbrace p.breadcrumbs);
@@ -2786,16 +2785,7 @@ and parseBracedOrRecordExpr p =
27862785
| _ -> valueOrConstructor
27872786
in
27882787
let expr =
2789-
parseRecordExpr ~startPos
2790-
[
2791-
( pathIdent,
2792-
{
2793-
valueOrConstructor with
2794-
pexp_attributes =
2795-
attrsForFields @ valueOrConstructor.pexp_attributes;
2796-
} );
2797-
]
2798-
p
2788+
parseRecordExpr ~startPos [(pathIdent, valueOrConstructor)] p
27992789
in
28002790
Parser.expect Rbrace p;
28012791
expr
@@ -6318,29 +6308,9 @@ and parseAttribute p =
63186308
] )
63196309
| _ -> None
63206310

6321-
and parseAttributeForFields p =
6322-
let isAttributeForField p =
6323-
Parser.lookahead p (function state ->
6324-
(Parser.next state;
6325-
match state.token with
6326-
| Lident ident -> ident = "optional"
6327-
| _ -> false))
6328-
in
6329-
match p.Parser.token with
6330-
| At when isAttributeForField p ->
6331-
let startPos = p.startPos in
6332-
Parser.next p;
6333-
let attrId = parseAttributeId ~startPos p in
6334-
let payload = parsePayload p in
6335-
Some (attrId, payload)
6336-
| _ -> None
6337-
63386311
and parseAttributes p =
63396312
parseRegion p ~grammar:Grammar.Attribute ~f:parseAttribute
63406313

6341-
and parseAttributesForFields p =
6342-
parseRegion p ~grammar:Grammar.Attribute ~f:parseAttributeForFields
6343-
63446314
(*
63456315
* standalone-attribute ::=
63466316
* | @@ atribute-id

0 commit comments

Comments
 (0)