-
Notifications
You must be signed in to change notification settings - Fork 19
/
exp.ml
53 lines (41 loc) · 1.15 KB
/
exp.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
type 'a located = Location.t * 'a
type rparam =
| Ppositional of Symbol.t
| Preq_keyword of Symbol.t
| Popt_keyword of Symbol.t * exp
and param = (rparam * Typector.typeterm option) located
and rargument =
| Apositional of exp
| Akeyword of Symbol.t * exp
and argument = rargument located
and rexp =
| Var of Symbol.t
| Lambda of param list * exp
| Let of Symbol.t * exp * exp
| Rec of Symbol.t * exp
| App of exp * argument list
| Seq of exp * exp
| Typed of exp * Typector.typeterm
| Unit
| Int of int
| Bool of bool
| If of exp * exp * exp
| Nil
| Cons of exp * exp
| Match of exp list * (pat list located * exp) list
| Object of Symbol.t option * (Symbol.t * exp) list
| GetField of exp * Symbol.t
and exp = rexp option located
and rpat =
| PWildcard
| PVar of Symbol.t
| PObject of Symbol.t option * (Symbol.t * pat) list
| PInt of int
| PAlt of pat * pat
and pat = rpat option located
and moditem =
| MType of Symbol.t * Typector.typaram list * Typector.typeterm
| MOpaqueType of Symbol.t * Typector.typaram list
| MDef of Symbol.t * param list * exp
| MLet of Symbol.t * exp
and modlist = moditem located list