@@ -15,29 +15,44 @@ type itemText = int [@@itemAttributeOnTypeDef];
1515
1616type nodeText = int ;
1717
18- type nodeAndItemText = int [@@ itemAttributeOnTypeDef ];
18+ type nodeAndItemText = int
19+ [@@ itemAttributeOnTypeDef ];
1920
2021type itemDoc = int [@@ itemAttributeOnTypeDef ];
2122
2223type nodeDoc = int [@@ itemAttributeOnTypeDef ];
2324
24- type nodeAndItemDoc = int [@@ itemAttributeOnTypeDef ];
25+ type nodeAndItemDoc = int
26+ [@@ itemAttributeOnTypeDef ];
2527
2628type x = int [@@ itemAttributeOnTypeDef ];
2729
2830type attributedInt = int [@ onTopLevelTypeDef ];
2931
30- type attributedIntsInTuple = (int [@ onInt ], float [@ onFloat ]) [@@ onTopLevelTypeDef ];
32+ type attributedIntsInTuple = (
33+ int [@ onInt ],
34+ float [@ onFloat ]
35+ )
36+ [@@ onTopLevelTypeDef ];
3137
3238type myDataType ' x ' y = | MyDataType of ' x ' y ;
3339
3440type myType =
35- (myDataType ((option int ) [@ onOptionInt ]) ((option float ) [@ onOption ])) [@ onEntireType ];
41+ (
42+ myDataType
43+ ((option int ) [@ onOptionInt ])
44+ ((option float ) [@ onOption ])
45+ )
46+ [@ onEntireType ];
3647
37- let thisInst : myType = MyDataType (Some 10 ) (Some 10 . 0 ) [@ attOnEntireDatatype ];
48+ let thisInst : myType =
49+ MyDataType (Some 10 ) (Some 10 . 0 )
50+ [@ attOnEntireDatatype ];
3851
3952let thisInst : myType =
40- MyDataType (Some 10 [@ onFirstParam ]) (Some 10 . 0 ) [@ attOnEntireDatatype ];
53+ MyDataType
54+ (Some 10 [@ onFirstParam ]) (Some 10 . 0 )
55+ [@ attOnEntireDatatype ];
4156
4257let x = "hello" [@ onHello ];
4358
@@ -112,7 +127,8 @@ let res =
112127
113128let add a b => ((a [@ onA ]) + b) [@ onEverything ];
114129
115- let add a b => ((a [@ onA ]) + (b [@ onB ])) [@ onEverything ];
130+ let add a b =>
131+ ((a [@ onA ]) + (b [@ onB ])) [@ onEverything ];
116132
117133let add a b => a + (b [@ onB ]);
118134
@@ -126,25 +142,34 @@ let both a b => (a && b) [@onEverything];
126142
127143let thisVal = 10 ;
128144
129- let x = 20 + (- (add thisVal thisVal [@ onFunctionCall ]));
145+ let x = 20 + (
146+ - (add thisVal thisVal [@ onFunctionCall ])
147+ );
130148
131- let x = (20 + (- (add thisVal thisVal))) [@ onEverything ];
149+ let x =
150+ (20 + (- (add thisVal thisVal)))
151+ [@ onEverything ];
132152
133153let x = - (add thisVal thisVal [@ onFunctionCall ]);
134154
135155let x = (- (add thisVal thisVal)) [@ onEverything ];
136156
137157let bothTrue x y => {contents: x && y};
138158
139- let something = ! (bothTrue true true ) [@ onEverythingToRightOfEquals ];
159+ let something =
160+ ! (bothTrue true true )
161+ [@ onEverythingToRightOfEquals ];
140162
141- let res = add 2 4 [@ appliesToEntireFunctionApplication ];
163+ let res =
164+ add 2 4 [@ appliesToEntireFunctionApplication ];
142165
143166add 2 4 [@ appliesToEntireFunctionApplication ];
144167
145168let myObj = {method p () => {method z () => 10 }};
146169
147- let result = (myObj# p () [@ attOnFirstSend ])# z () [@ onSecondSend ];
170+ let result =
171+ (myObj# p () [@ attOnFirstSend ])# z
172+ () [@ onSecondSend ];
148173
149174type recordFunctions = {
150175 p: unit => recordFunctions [@ onUnit ],
@@ -153,17 +178,29 @@ type recordFunctions = {
153178[@@ onRecordFunctions ]
154179and unusedType = unit [@@ onUnusedType ];
155180
156- let rec myRecord = {p: fun () => myRecord, q: fun () => () }
181+ let rec myRecord = {
182+ p: fun () => myRecord,
183+ q: fun () => ()
184+ }
157185and unused = () ;
158186
159- let result = (myRecord. p () [@ attOnFirstSend ]).q () [@ onSecondSend ];
187+ let result =
188+ (myRecord. p () [@ attOnFirstSend ]).q
189+ () [@ onSecondSend ];
160190
161- type variantType = | Foo of int [@ onInt ] | Bar of (int [@ onInt ]) | Baz [@@ onVariantType ];
191+ type variantType =
192+ | Foo of int [@ onInt ]
193+ | Bar of (int [@ onInt ])
194+ | Baz
195+ [@@ onVariantType ];
162196
163197type gadtType ' x =
164198 | Foo of int : (gadtType int ) [@ onFirstRow ]
165- | Bar of (int [@ onInt ]) : (gadtType unit ) [@ onSecondRow ]
166- | Baz : (gadtType (unit [@ onUnit ])) [@ onThirdRow ]
199+ | Bar of
200+ (int [@ onInt ])
201+ : (gadtType unit ) [@ onSecondRow ]
202+ | Baz
203+ : (gadtType (unit [@ onUnit ])) [@ onThirdRow ]
167204[@@ onVariantType ];
168205
169206[@@@ floatingTopLevelStructureItem hello];
@@ -235,7 +272,10 @@ class tupleClass 'a 'b (init: ('a, 'b)) => {
235272class type addablePointClassType = {
236273 method x : int ;
237274 method y : int ;
238- method add : addablePointClassType => addablePointClassType => int
275+ method add :
276+ addablePointClassType =>
277+ addablePointClassType =>
278+ int
239279}
240280[@@ structureItem ]
241281and anotherClassType = {
@@ -244,7 +284,9 @@ and anotherClassType = {
244284}
245285[@@ structureItem ];
246286
247- let module NestedModule = {[@@@ floatingNestedStructureItem hello];};
287+ let module NestedModule = {
288+ [@@@ floatingNestedStructureItem hello];
289+ };
248290
249291module type HasAttrs = {
250292 type t = int [@@ onTypeDef ];
@@ -261,13 +303,19 @@ type s = | S of string;
261303
262304let S (str [@ onStr ]) = S ("hello" [@ onHello ]);
263305
264- let S str [@ onConstruction ] = S "hello" [@ onConstruction ];
306+ let S str [@ onConstruction ] =
307+ S "hello" [@ onConstruction ];
265308
266309type xy = | X of string | Y of string ;
267310
268- let myFun (X hello [@ onConstruction ] | Y hello [@ onConstruction ]) => hello;
311+ let myFun
312+ (
313+ X hello [@ onConstruction ] |
314+ Y hello [@ onConstruction ]
315+ ) => hello;
269316
270- let myFun (X (hello [@ onHello ]) | Y (hello [@ onHello ])) => hello;
317+ let myFun
318+ (X (hello [@ onHello ]) | Y (hello [@ onHello ])) => hello;
271319
272320/* Another bug: Cannot have an attribute on or pattern
273321 let myFun = fun ((X hello | Y hello) [@onOrPattern]) => hello;
0 commit comments