-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgrammar.ml
More file actions
95 lines (84 loc) · 2.34 KB
/
Copy pathgrammar.ml
File metadata and controls
95 lines (84 loc) · 2.34 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
(* This is free and unencumbered software released into the public domain. *)
type program = definition list
and definition =
| Const of identifier * type' * expression
| Global of identifier * type' * expression option
| Function of function'
and function' =
modifier * identifier * parameter list * expression list
and modifier =
| Private
| Public
| PublicPure
and parameter = identifier * type' option
and expression =
| Assert of expression * expression
| Identifier of identifier
| Literal of literal
| SomeExpression of expression
| ListExpression of expression list
| RecordExpression of binding list
| IsNone of expression
| IsSome of expression
| IsErr of expression
| IsOk of expression
| DefaultTo of expression * expression
| VarGet of identifier
| VarSet of identifier * expression
| Err of expression
| Ok of expression
| Not of expression
| And of expression list
| Or of expression list
| Eq of expression list
| Lt of expression * expression
| Le of expression * expression
| Gt of expression * expression
| Ge of expression * expression
| Add of expression list
| Sub of expression list
| Mul of expression list
| Div of expression list
| Mod of expression * expression
| Pow of expression * expression
| Xor of expression * expression
| Len of expression
| ToInt of expression
| ToUint of expression
| FunctionRef of identifier
| FunctionCall of identifier * expression list
| Try of expression
| Unwrap of expression * expression
| UnwrapPanic of expression
| UnwrapErr of expression * expression
| UnwrapErrPanic of expression
| If of expression * expression * expression
| Let of binding list * expression list
| Match of expression * binding * binding
and binding = identifier * expression
and literal =
| NoneLiteral
| BoolLiteral of bool
| I64Literal of int64
| U64Literal of int64
| I128Literal of Big_int.big_int
| U128Literal of Big_int.big_int
| BufferLiteral of string
| StringLiteral of string
| RecordLiteral of identifier * literal
and identifier = string
and type' =
| Principal
| Bool
| I64
| U64
| I128
| U128
| Optional of type'
| Response of type' * type'
| Buff of int
| String of int
| List of int * type'
| Map of type' * type'
| Record of record_field list
and record_field = identifier * type'