File tree Expand file tree Collapse file tree 3 files changed +3
-14
lines changed Expand file tree Collapse file tree 3 files changed +3
-14
lines changed Original file line number Diff line number Diff line change 60
60
let ( let * ) = Output. bind
61
61
62
62
module Operators = struct
63
- type 'a t =
64
- | Number of float * float
65
- | Str of string * string
66
- | Obj of (string * 'a ) list * (string * 'a ) list
67
-
68
63
let not (json : Json.t ) =
69
64
match json with
70
65
| `Bool false | `Null -> Output. return (`Bool true )
Original file line number Diff line number Diff line change 11
11
% token < bool > BOOL
12
12
% token NULL
13
13
% token < string > IDENTIFIER
14
- % token RANGE ABS ADDFUN
14
+ % token RANGE
15
15
% token IF THEN ELSE ELIF END
16
16
% token DOT
17
17
% token RECURSE
@@ -132,10 +132,6 @@ term:
132
132
| x :: y :: z :: [] -> Range (x, Some y, Some z)
133
133
| _ -> failwith " too many arguments for function range"
134
134
}
135
- | ABS
136
- { Fun (Abs ) }
137
- | ADDFUN
138
- { Fun (Add ) }
139
135
| f = FUNCTION ; CLOSE_PARENT ;
140
136
{ failwith (f ^ " (), should contain a body" ) }
141
137
| f = FUNCTION ; cb = sequence_expr; CLOSE_PARENT ;
@@ -198,6 +194,8 @@ term:
198
194
| "nan" -> Nan
199
195
| "is_nan" -> IsNan
200
196
| "not" -> Not
197
+ | "abs" -> Fun (Abs )
198
+ | "add" -> Fun (Add )
201
199
(* TODO: remove failwiths once we have implemented the functions *)
202
200
| "if" -> failwith @@ Console.Errors. not_implemented f
203
201
| "then" -> failwith @@ Console.Errors. not_implemented f
Original file line number Diff line number Diff line change @@ -45,8 +45,6 @@ type token =
45
45
| ELSE
46
46
| ELIF
47
47
| END
48
- | ABS
49
- | ADDFUN
50
48
| EOF
51
49
[@@ deriving show ]
52
50
@@ -107,8 +105,6 @@ let rec tokenize buf =
107
105
| "else" -> Ok ELSE
108
106
| "elif" -> Ok ELIF
109
107
| "end" -> Ok END
110
- | "abs" -> Ok ABS
111
- | "add" -> Ok ADDFUN
112
108
| dot -> Ok DOT
113
109
| ".." -> Ok RECURSE
114
110
| '"' -> string buf
You can’t perform that action at this time.
0 commit comments