Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4329600

Browse files
committed
unify
1 parentbf61d77 commit4329600

File tree

1 file changed

+12
-33
lines changed

1 file changed

+12
-33
lines changed

‎compiler/syntax/src/res_core.ml‎

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ module Parser = Res_parser
1010
letmk_locstart_locend_loc=
1111
Location.{loc_start= start_loc; loc_end= end_loc; loc_ghost=false}
1212

13+
letrecskip_doc_commentsp=
14+
match p.Parser.tokenwith
15+
|DocComment_ ->
16+
Parser.next p;
17+
skip_doc_comments p
18+
|_ ->()
19+
1320
typeinline_types_context= {
1421
mutablefound_inline_types:
1522
(string*Warnings.loc*Parsetree.type_kind)list;
@@ -5174,42 +5181,21 @@ and parse_type_representation ?current_type_name_path ?inline_types_context p =
51745181
let after_attrs=
51755182
Parser.lookahead p (funstate ->
51765183
ignore (parse_attributes state);
5177-
letrecskip_docs()=
5178-
match state.Parser.tokenwith
5179-
|DocComment_ ->
5180-
Parser.next state;
5181-
skip_docs()
5182-
|_ ->()
5183-
in
5184-
skip_docs();
5184+
skip_doc_comments state;
51855185
state.Parser.token)
51865186
in
51875187
match after_attrswith
51885188
|Lbrace ->
51895189
(* consume the attributes and any doc comments before the record*)
51905190
ignore (parse_attributes p);
5191-
letrecskip_docs()=
5192-
match p.Parser.tokenwith
5193-
|DocComment_ ->
5194-
Parser.next p;
5195-
skip_docs()
5196-
|_ ->()
5197-
in
5198-
skip_docs();
5191+
skip_doc_comments p;
51995192
Parsetree.Ptype_record
52005193
(parse_record_declaration ?current_type_name_path
52015194
?inline_types_context p)
52025195
|DotDot ->
52035196
(* attributes before an open variant marker; consume attrs/docs then handle `..`*)
52045197
ignore (parse_attributes p);
5205-
letrecskip_docs()=
5206-
match p.Parser.tokenwith
5207-
|DocComment_ ->
5208-
Parser.next p;
5209-
skip_docs()
5210-
|_ ->()
5211-
in
5212-
skip_docs();
5198+
skip_doc_comments p;
52135199
Parser.next p;
52145200
(* consume DotDot*)
52155201
Ptype_open
@@ -5784,14 +5770,7 @@ and parse_type_equation_and_representation ?current_type_name_path
57845770
Parser.lookahead p (funstate ->
57855771
ignore (parse_attributes state);
57865772
(* optionally skip a run of doc comments before deciding*)
5787-
letrecskip_docs()=
5788-
match state.Parser.tokenwith
5789-
|DocComment_ ->
5790-
Parser.next state;
5791-
skip_docs()
5792-
|_ ->()
5793-
in
5794-
skip_docs();
5773+
skip_doc_comments state;
57955774
match state.Parser.tokenwith
57965775
|Lbrace -> (
57975776
(* Disambiguate record declaration vs object type.
@@ -5801,7 +5780,7 @@ and parse_type_equation_and_representation ?current_type_name_path
58015780
Parser.next state;
58025781
(* consume Lbrace*)
58035782
ignore (parse_attributes state);
5804-
skip_docs();
5783+
skip_doc_comments state;
58055784
match state.Parser.tokenwith
58065785
|String_|Dot|DotDot|DotDotDot ->
58075786
false(* object type => manifest*)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp