@@ -138,29 +138,29 @@ term:
138
138
{ match f with
139
139
| "filter" -> Map (Select cb) (* for backward compatibility *)
140
140
| "map" -> Map cb
141
- | "flat_map" -> FlatMap cb
141
+ | "flat_map" -> Flat_map cb
142
142
| "select" -> Select cb
143
- | "sort_by" -> SortBy cb
144
- | "min_by" -> MinBy cb
145
- | "max_by" -> MaxBy cb
146
- | "group_by" -> GroupBy cb
147
- | "unique_by" -> UniqueBy cb
143
+ | "sort_by" -> Sort_by cb
144
+ | "min_by" -> Min_by cb
145
+ | "max_by" -> Max_by cb
146
+ | "group_by" -> Group_by cb
147
+ | "unique_by" -> Unique_by cb
148
148
| "find" -> Find cb
149
149
| "some" -> Some_ cb
150
150
| "path" -> Path cb
151
- | "any" -> AnyWithCondition cb
152
- | "all" -> AllWithCondition cb
151
+ | "any" -> Any_with_condition cb
152
+ | "all" -> All_with_condition cb
153
153
| "walk" -> Walk cb
154
154
| "transpose" -> Transpose cb
155
155
| "has" -> Has cb
156
156
| "in" -> In cb
157
- | "starts_with" -> StartsWith cb
158
- | "ends_with" -> EndsWith cb
157
+ | " startswith" (* for backward compatibility *)
158
+ | "starts_with" -> Starts_with cb
159
+ | " endswith" (* for backward compatibility *)
160
+ | "ends_with" -> Ends_with cb
159
161
| "split" -> Split cb
160
162
| "join" -> Join cb
161
163
| "contains" -> Contains cb
162
- | "startswith" -> failwith @@ Console.Errors. renamed f " starts_with"
163
- | "endswith" -> failwith @@ Console.Errors. renamed f " ends_with"
164
164
| _ -> failwith @@ Console.Errors. missing f
165
165
}
166
166
| f = IDENTIFIER ;
@@ -171,44 +171,38 @@ term:
171
171
| "head" -> Head
172
172
| "tail" -> Tail
173
173
| "length" -> Length
174
- | "to_string" -> ToString
175
- | "to_num" -> ToNumber
174
+ | " tostring" (* for backward compatibility *)
175
+ | "to_string" -> To_string
176
+ | " tonumber" (* for backward compatibility *)
177
+ | "to_num" -> To_number
176
178
| "type" -> Type
177
179
| "sort" -> Sort
178
- | "uniq" -> Unique
180
+ | " uniq"
181
+ | "unique" -> Unique
179
182
| "reverse" -> Reverse
180
183
| "floor" -> Floor
181
184
| "sqrt" -> Sqrt
182
185
| "min" -> Min
183
186
| "max" -> Max
184
- | "unique" -> Unique
185
187
| "explode" -> Explode
186
188
| "implode" -> Implode
187
189
| "any" -> Any
188
190
| "all" -> All
189
191
| "recurse" -> Recurse
190
- | "recurse_down" -> RecurseDown
191
- | "to_entries" -> ToEntries
192
- | "from_entries" -> FromEntries
193
- | "with_entries" -> WithEntries
192
+ | "recurse_down" -> Recurse_down
193
+ | "to_entries" -> To_entries
194
+ | "from_entries" -> From_entries
195
+ | "with_entries" -> With_entries
194
196
| "nan" -> Nan
195
- | "is_nan" -> IsNan
197
+ | "is_nan" -> Is_nan
196
198
| "not" -> Not
197
- | "abs" -> Fun (Abs )
199
+ | "abs" -> Fun (Absolute )
198
200
| "add" -> Fun (Add )
199
201
(* TODO: remove failwiths once we have implemented the functions *)
200
- | "if" -> failwith @@ Console.Errors. not_implemented f
201
- | "then" -> failwith @@ Console.Errors. not_implemented f
202
- | "else" -> failwith @@ Console.Errors. not_implemented f
203
- | "break" -> failwith @@ Console.Errors. not_implemented f
204
- (* TODO: remove failwiths once we have implemented the functions *)
205
202
| "isnan" -> failwith @@ Console.Errors. renamed f " is_nan"
206
- | "reduce" -> failwith @@ Console.Errors. renamed f " reduce()"
207
- | "tonumber" -> failwith @@ Console.Errors. renamed f " to_number"
208
203
| "isinfinite" -> failwith @@ Console.Errors. renamed f " is_infinite"
209
204
| "isfinite" -> failwith @@ Console.Errors. renamed f " is_finite"
210
205
| "isnormal" -> failwith @@ Console.Errors. renamed f " is_normal"
211
- | "tostring" -> failwith @@ Console.Errors. renamed f " to_string"
212
206
| _ -> failwith @@ Console.Errors. missing f
213
207
}
214
208
| OPEN_BRACKET ; CLOSE_BRACKET ;
@@ -269,7 +263,7 @@ term:
269
263
let rec fold_elif elifs else_branch =
270
264
match elifs with
271
265
| [] -> else_branch
272
- | (cond , branch ) :: rest -> IfThenElse (cond, branch, fold_elif rest else_branch)
266
+ | (cond , branch ) :: rest -> If_then_else (cond, branch, fold_elif rest else_branch)
273
267
in
274
- IfThenElse (cond, e1, fold_elif elifs e2)
268
+ If_then_else (cond, e1, fold_elif elifs e2)
275
269
}
0 commit comments