Skip to content

Commit 5a0912d

Browse files
clean code
1 parent 89d1ac7 commit 5a0912d

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

source/Compiler.ml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ end
6060
let ( let* ) = Output.bind
6161

6262
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-
6863
let not (json : Json.t) =
6964
match json with
7065
| `Bool false | `Null -> Output.return (`Bool true)

source/Parser.mly

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
%token <bool> BOOL
1212
%token NULL
1313
%token <string> IDENTIFIER
14-
%token RANGE ABS ADDFUN
14+
%token RANGE
1515
%token IF THEN ELSE ELIF END
1616
%token DOT
1717
%token RECURSE
@@ -132,10 +132,6 @@ term:
132132
| x :: y :: z :: [] -> Range (x, Some y, Some z)
133133
| _ -> failwith "too many arguments for function range"
134134
}
135-
| ABS
136-
{ Fun (Abs) }
137-
| ADDFUN
138-
{ Fun (Add) }
139135
| f = FUNCTION; CLOSE_PARENT;
140136
{ failwith (f ^ "(), should contain a body") }
141137
| f = FUNCTION; cb = sequence_expr; CLOSE_PARENT;
@@ -198,6 +194,8 @@ term:
198194
| "nan" -> Nan
199195
| "is_nan" -> IsNan
200196
| "not" -> Not
197+
| "abs" -> Fun (Abs)
198+
| "add" -> Fun (Add)
201199
(* TODO: remove failwiths once we have implemented the functions *)
202200
| "if" -> failwith @@ Console.Errors.not_implemented f
203201
| "then" -> failwith @@ Console.Errors.not_implemented f

source/Tokenizer.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ type token =
4545
| ELSE
4646
| ELIF
4747
| END
48-
| ABS
49-
| ADDFUN
5048
| EOF
5149
[@@deriving show]
5250

@@ -107,8 +105,6 @@ let rec tokenize buf =
107105
| "else" -> Ok ELSE
108106
| "elif" -> Ok ELIF
109107
| "end" -> Ok END
110-
| "abs" -> Ok ABS
111-
| "add" -> Ok ADDFUN
112108
| dot -> Ok DOT
113109
| ".." -> Ok RECURSE
114110
| '"' -> string buf

0 commit comments

Comments
 (0)