Skip to content

Commit 863382e

Browse files
promote tests
1 parent 044e370 commit 863382e

17 files changed

+109
-37
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Warning: tests/js_source.ml:156 exceeds the margin
2-
Warning: tests/js_source.ml:3558 exceeds the margin
3-
Warning: tests/js_source.ml:9546 exceeds the margin
4-
Warning: tests/js_source.ml:9649 exceeds the margin
5-
Warning: tests/js_source.ml:9668 exceeds the margin
6-
Warning: tests/js_source.ml:9708 exceeds the margin
7-
Warning: tests/js_source.ml:9790 exceeds the margin
2+
Warning: tests/js_source.ml:3563 exceeds the margin
3+
Warning: tests/js_source.ml:9551 exceeds the margin
4+
Warning: tests/js_source.ml:9654 exceeds the margin
5+
Warning: tests/js_source.ml:9673 exceeds the margin
6+
Warning: tests/js_source.ml:9713 exceeds the margin
7+
Warning: tests/js_source.ml:9795 exceeds the margin

test/passing/tests/js_source.ml.ref

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,14 @@ class%foo x = x [@@foo]
181181
class type%foo x = x [@@foo]
182182
external%foo x : _ = "" [@@foo]
183183
exception%foo X [@foo]
184-
module%foo M = M [@@foo]
185184

186-
module%foo rec M : S = M [@@foo]
187-
and M : S = M [@@foo]
185+
module%foo [@foo] M = M
186+
187+
module%foo [@foo] rec M : S = M
188+
and [@foo] M : S = M
189+
190+
module type%foo [@foo] S = S
188191

189-
module type%foo S = S [@@foo]
190192
include%foo M [@@foo]
191193
open%foo M [@@foo]
192194

@@ -200,13 +202,16 @@ module type S = sig
200202

201203
type%foo t += T [@@foo]
202204
exception%foo X [@foo]
205+
203206
module%foo [@foo] M : S
204207

205208
module%foo [@foo] rec M : S
206209
and [@foo] M : S
207210

208211
module%foo [@foo] M = M
209-
module type%foo S = S [@@foo]
212+
213+
module type%foo [@foo] S = S
214+
210215
include%foo M [@@foo]
211216
open%foo M [@@foo]
212217
class%foo x : t [@@foo]

test/passing/tests/protected_object_types.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ module Space_around = struct
2626
[--space-around-*] options are sufficient. *)
2727

2828
module Records = struct
29-
type t = { foo: < .. > }
29+
type t = {foo: < .. > }
3030

31-
type t = A of { foo: < .. > }
31+
type t = A of {foo: < .. > }
3232
end
3333
[@@ocamlformat "space-around-records = true"]
3434

3535
module Variants = struct
36-
type t = [ `Foo of < .. > ]
36+
type t = [`Foo of < .. > ]
3737
end
3838
[@@ocamlformat "space-around-variants"]
3939
end

test/passing/tests/source.ml.ref

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ external%foo x : _ = "" [@@foo]
226226

227227
exception%foo X [@foo]
228228

229-
module%foo M = M [@@foo]
229+
module%foo [@foo] M = M
230230

231-
module%foo rec M : S = M [@@foo]
231+
module%foo [@foo] rec M : S = M
232232

233-
and M : S = M [@@foo]
233+
and [@foo] M : S = M
234234

235-
module type%foo S = S [@@foo]
235+
module type%foo [@foo] S = S
236236

237237
include%foo M [@@foo]
238238

@@ -260,7 +260,7 @@ module type S = sig
260260

261261
module%foo [@foo] M = M
262262

263-
module type%foo S = S [@@foo]
263+
module type%foo [@foo] S = S
264264

265265
include%foo M [@@foo]
266266

vendor/diff-parsers-ext-parsewyc.patch

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,7 @@
238238
| [] ->
239239
let post = rhs_post_text endpos in
240240
@@@@
241-
let docs = symbol_docs loc in
242-
{
243-
lb_pattern = p;
244-
lb_expression = e;
245-
lb_is_pun = is_pun;
246-
- lb_attributes = (add_docs_attrs docs attrs);
247-
+ lb_attributes = add_docs_attrs docs attrs;
241+
lb_attributes = add_text_attrs text (add_docs_attrs docs attrs);
248242
lb_loc = make_loc loc;
249243
}
250244

@@ -403,16 +397,13 @@
403397
produces a first-class module that we wish to unpack. *)
404398
%inline expr_colon_package_type:
405399
@@@@
406-
ext = ext
407-
before = attributes
408400
body = body
409401
after = post_item_attributes
410402
{ let loc = make_loc $sloc in
411-
- let docs = symbol_docs $sloc in
412-
let text = symbol_text $symbolstartpos in
413-
+ let docs = symbol_docs $sloc in
403+
let docs = symbol_docs $sloc in
414404
let attrs = Attr.ext_attrs ?ext ~before ~after () in
415-
body ~loc ~attrs ~docs ~text }
405+
- body ~loc ~attrs ~docs ~text:None }
406+
+ body ~text:None ~loc ~attrs ~docs }
416407

417408

418409
%inline ext_attrs_no_ext(kw, body):
@@ -421,11 +412,12 @@
421412
body = body
422413
after = post_item_attributes
423414
{ let loc = make_loc $sloc in
424-
+ let text = symbol_text $symbolstartpos in
415+
+ let text = Some (symbol_text $symbolstartpos) in
425416
let docs = symbol_docs $sloc in
426-
- let text = symbol_text $symbolstartpos in
417+
- let text = Some (symbol_text $symbolstartpos) in
427418
let attrs = Attr.ext_attrs ~before ~after () in
428-
body ~loc ~attrs ~docs ~text }
419+
- body ~loc ~attrs ~docs ~text }
420+
+ body ~text ~loc ~attrs ~docs }
429421

430422
(* A single module binding. *)
431423
%inline module_binding:
@@ -474,6 +466,17 @@
474466

475467
(* The following bindings in a group of recursive module bindings. *)
476468
%inline and_module_binding:
469+
ext_attrs_no_ext (
470+
AND,
471+
name = mkrhs(module_name)
472+
body = module_binding_body
473+
- { fun ~text -> Mb.mk_exh ~text name body }
474+
+ { Mb.mk_exh name body }
475+
)
476+
{ $1 }
477+
;
478+
479+
(* -------------------------------------------------------------------------- *)
477480
@@@@
478481
Incl.mk thing ~attrs ~loc ~docs, ext
479482
}
@@ -613,6 +616,19 @@
613616
ext_attrs_no_ext (
614617
AND,
615618
@@@@
619+
{
620+
let attrs = attrs1 @ attrs2 in
621+
let loc = make_loc $sloc in
622+
let docs = symbol_docs $sloc in
623+
let text = symbol_text $symbolstartpos in
624+
- Ci.mk id body ~virt ~params ~attrs ~loc ~text ~docs
625+
+ Ci.mk id body ~virt ~params ~attrs ~loc ~docs ~text
626+
}
627+
;
628+
629+
class_fun_binding:
630+
EQUAL class_expr
631+
@@@@
616632

617633
(* -------------------------------------------------------------------------- *)
618634

@@ -673,6 +689,32 @@
673689
| LET OPEN override_flag attributes mkrhs(mod_longident) IN class_signature
674690
{ let loc = ($startpos($2), $endpos($5)) in
675691
let od = Opn.mk ~override:$3 ~loc:(make_loc loc) $5 in
692+
@@@@
693+
{
694+
let attrs = attrs1 @ attrs2 in
695+
let loc = make_loc $sloc in
696+
let docs = symbol_docs $sloc in
697+
let text = symbol_text $symbolstartpos in
698+
- Ci.mk id cty ~virt ~params ~attrs ~loc ~text ~docs
699+
+ Ci.mk id cty ~virt ~params ~attrs ~loc ~docs ~text
700+
}
701+
;
702+
class_type_declarations:
703+
xlist(class_type_declaration, and_class_type_declaration)
704+
{ $1 }
705+
@@@@
706+
{
707+
let attrs = attrs1 @ attrs2 in
708+
let loc = make_loc $sloc in
709+
let docs = symbol_docs $sloc in
710+
let text = symbol_text $symbolstartpos in
711+
- Ci.mk id csig ~virt ~params ~attrs ~loc ~text ~docs
712+
+ Ci.mk id csig ~virt ~params ~attrs ~loc ~docs ~text
713+
}
714+
;
715+
716+
/* Core expressions */
717+
676718
@@@@
677719
{ array, d, Brace, i, r }
678720
| array=simple_expr d=dot LBRACKET i=index RBRACKET r=right
@@ -969,6 +1011,21 @@
9691011
ps = separated_or_terminated_nonempty_list(SEMI, pattern)
9701012
{ ps }
9711013
;
1014+
@@@@
1015+
cstrs = constraints
1016+
attrs2 = post_item_attributes
1017+
{
1018+
let (kind, priv, manifest) = kind_priv_manifest in
1019+
let docs = symbol_docs $sloc in
1020+
- let text = symbol_text $symbolstartpos in
1021+
let attrs = attrs1 @ attrs2 in
1022+
let loc = make_loc $sloc in
1023+
+ let text = symbol_text $symbolstartpos in
1024+
Type.mk id ~params ~cstrs ~kind ~priv ?manifest ~attrs ~loc ~docs ~text
1025+
}
1026+
;
1027+
%inline constraints:
1028+
llist(preceded(CONSTRAINT, constrain))
9721029
@@@@
9731030
| BANG { [ mkvarinj "!" $sloc ] }
9741031
| PLUS BANG { [ mkvarinj "+" $loc($1); mkvarinj "!" $loc($2) ] }

vendor/parser-extended/parser.mly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2793,9 +2793,9 @@ generic_type_declaration(flag, kind):
27932793
{
27942794
let (kind, priv, manifest) = kind_priv_manifest in
27952795
let docs = symbol_docs $sloc in
2796-
let text = symbol_text $symbolstartpos in
27972796
let attrs = attrs1 @ attrs2 in
27982797
let loc = make_loc $sloc in
2798+
let text = symbol_text $symbolstartpos in
27992799
Type.mk id ~params ~cstrs ~kind ~priv ?manifest ~attrs ~loc ~docs ~text
28002800
}
28012801
;

vendor/parser-recovery/lib/recovery_parser.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ meth_list ::= LIDENT . COLON possibly_poly(core_t
635635

636636

637637
# State 1158 is preventing recovery from 1 states:
638-
signature_item ::= MODULE (ext = ext) list(attribute) REC module_name COLON . (mty = module_type) list(post_item_attribute) (bs = list(and_module_declaration))
638+
signature_item ::= MODULE (ext = ext) list(attribute) REC module_name COLON . (mty = module_type) list(post_item_attribute) list(and_module_declaration)
639639

640640

641641
# State 1050 is preventing recovery from 1 states:

vendor/parser-recovery/test/expect/signature/unclosed_paren_module_type.mli.ref

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
signature_item ([1,0+0]..[1,0+19])
33
Psig_module
44
module_declaration "M" ([1,0+7]..[1,0+8]) ([1,0+0]..[1,0+19])
5+
None
56
module_type ([1,0+12]..[1,0+19])
67
Pmty_signature
78
[]

vendor/parser-recovery/test/expect/signature/unclosed_sig.mli.ref

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
signature_item ([1,0+0]..[1,0+22])
33
Psig_module
44
module_declaration "K" ([1,0+7]..[1,0+8]) ([1,0+0]..[1,0+22])
5+
None
56
module_type ([1,0+11]..[1,0+22])
67
Pmty_signature
78
[

vendor/parser-recovery/test/expect/structure/invalid_seq_modules.ml.ref

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
structure_item ([1,0+0]..[1,0+105])
33
Pstr_module
44
module_binding "M" ([1,0+7]..[1,0+8]) ([1,0+0]..[1,0+105])
5+
None
56
module_expr ([1,0+11]..[1,0+105])
67
Pmod_structure
78
[

0 commit comments

Comments
 (0)