@@ -111,7 +111,7 @@ module CodePrinter = struct
111
111
let id x = x
112
112
113
113
(* * add a write event to the context *)
114
- let ( !- ) str ctx =
114
+ let write str ctx =
115
115
{
116
116
ctx with
117
117
events = Write str :: ctx .events;
@@ -135,16 +135,16 @@ module CodePrinter = struct
135
135
}
136
136
|> updateMode true
137
137
138
- let sepSpace ctx = ! - " " ctx
139
- let sepComma ctx = ! - " , " ctx
140
- let sepSemi ctx = ! - " ; " ctx
141
- let sepOpenT ctx = ! - " (" ctx
142
- let sepCloseT ctx = ! - " )" ctx
143
- let sepOpenR ctx = ! - " {" ctx
144
- let sepCloseR ctx = ! - " }" ctx
145
- let sepOpenL ctx = ! - " [" ctx
146
- let sepCloseL ctx = ! - " ]" ctx
147
- let sepEq ctx = ! - " = " ctx
138
+ let sepSpace ctx = write " " ctx
139
+ let sepComma ctx = write " , " ctx
140
+ let sepSemi ctx = write " ; " ctx
141
+ let sepOpenT ctx = write " (" ctx
142
+ let sepCloseT ctx = write " )" ctx
143
+ let sepOpenR ctx = write " {" ctx
144
+ let sepCloseR ctx = write " }" ctx
145
+ let sepOpenL ctx = write " [" ctx
146
+ let sepCloseL ctx = write " ]" ctx
147
+ let sepEq ctx = write " = " ctx
148
148
let wrapInParentheses f = sepOpenT +> f +> sepCloseT
149
149
let indent ctx =
150
150
let nextIdent = ctx.current_indent + ctx.indent_size in
@@ -198,14 +198,14 @@ module CodePrinter = struct
198
198
| Application (name , argument ) -> genApplication name argument
199
199
| Record record -> genRecord record
200
200
| Ident ident -> genIdent ident
201
- | String str -> ! - (Format. sprintf " \" %s\" " str)
201
+ | String str -> write (Format. sprintf " \" %s\" " str)
202
202
| Tuple ts -> genTuple ts
203
203
| List xs -> genList xs
204
204
205
205
and genApplication (name : string ) (argument : oak ) : appendEvents =
206
- let short = ! - name +> sepOpenT +> genOak argument +> sepCloseT in
206
+ let short = write name +> sepOpenT +> genOak argument +> sepCloseT in
207
207
let long =
208
- ! - name +> sepOpenT
208
+ write name +> sepOpenT
209
209
+> (match argument with
210
210
| List _ | Record _ -> genOak argument
211
211
| _ -> indentAndNln (genOak argument) +> sepNln)
@@ -234,17 +234,17 @@ module CodePrinter = struct
234
234
let long = col genNamedField sepNln oaks in
235
235
expressionFitsOnRestOfLine short long
236
236
237
- and genIdent (ident : string ) : appendEvents = ! - ident
237
+ and genIdent (ident : string ) : appendEvents = write ident
238
238
239
239
and genNamedField (field : namedField ) : appendEvents =
240
240
let genValue =
241
241
match field.value with
242
242
| Tuple _ -> sepOpenT +> genOak field.value +> sepCloseT
243
243
| _ -> genOak field.value
244
244
in
245
- let short = ! - (field.name) +> sepEq +> genValue in
245
+ let short = write (field.name) +> sepEq +> genValue in
246
246
let long =
247
- ! - (field.name) +> sepEq
247
+ write (field.name) +> sepEq
248
248
+>
249
249
match field.value with
250
250
| List _ | Record _ -> genOak field.value
0 commit comments