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

Commit 7cdefef

Browse files
authored
Move parseSpecification and parseImplementation outside of let rec (#515)
1 parent 11594ce commit 7cdefef

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/res_core.ml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5329,11 +5329,6 @@ and parseExceptionDef ~attrs p =
53295329
let loc = mkLoc startPos p.prevEndPos in
53305330
Ast_helper.Te.constructor ~loc ~attrs name kind
53315331

5332-
(* module structure on the file level *)
5333-
and parseImplementation p : Parsetree.structure =
5334-
parseRegion p ~grammar:Grammar.Implementation ~f:parseStructureItemRegion
5335-
[@@progress (Parser.next, Parser.expect, Parser.checkProgress)]
5336-
53375332
and parseNewlineOrSemicolonStructure p =
53385333
match p.Parser.token with
53395334
| Semicolon ->
@@ -6070,11 +6065,6 @@ and parseModuleTypeOf p =
60706065
let moduleExpr = parseModuleExpr p in
60716066
Ast_helper.Mty.typeof_ ~loc:(mkLoc startPos p.prevEndPos) moduleExpr
60726067

6073-
(* module signature on the file level *)
6074-
and parseSpecification p =
6075-
parseRegion ~grammar:Grammar.Specification ~f:parseSignatureItemRegion p
6076-
[@@progress (Parser.next, Parser.expect, Parser.checkProgress)]
6077-
60786068
and parseNewlineOrSemicolonSignature p =
60796069
match p.Parser.token with
60806070
| Semicolon ->
@@ -6452,3 +6442,13 @@ and parseExtension ?(moduleLanguage=false) p =
64526442
let attrId = parseAttributeId ~startPos p in
64536443
let payload = parsePayload p in
64546444
(attrId, payload)
6445+
6446+
(* module signature on the file level *)
6447+
let parseSpecification p : Parsetree.signature =
6448+
parseRegion p ~grammar:Grammar.Specification ~f:parseSignatureItemRegion
6449+
[@@progress (Parser.next, Parser.expect, Parser.checkProgress)]
6450+
6451+
(* module structure on the file level *)
6452+
let parseImplementation p : Parsetree.structure =
6453+
parseRegion p ~grammar:Grammar.Implementation ~f:parseStructureItemRegion
6454+
[@@progress (Parser.next, Parser.expect, Parser.checkProgress)]

0 commit comments

Comments
 (0)