-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrammar.ml
More file actions
91 lines (80 loc) · 2.33 KB
/
Copy pathgrammar.ml
File metadata and controls
91 lines (80 loc) · 2.33 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
(* This is free and unencumbered software released into the public domain. *)
type program = definition list
and definition =
| Constant of identifier * expression
| DataVar of identifier * type' * expression
| Map of identifier * (identifier * type') * (identifier * type')
| PublicFunction of function'
| PublicReadOnlyFunction of function'
| PrivateFunction of function'
and function' = identifier * parameter list * expression list
and parameter = identifier * type'
and expression =
| Keyword of identifier
| Identifier of identifier
| Literal of literal
| SomeExpression of expression
| ListExpression of expression list
| TupleExpression of binding list
| IsEq of expression 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
| 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
| 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
| IntLiteral of Integer.t
| UintLiteral of Integer.t
| BuffLiteral of string
| StringLiteral of string
| TupleLiteral of (identifier * literal) list
and identifier = string
and type' =
| Unit
| Principal
| Bool
| Int
| Uint
| Optional of type'
| Response of type' * type'
| Buff of int
| String of int * string_encoding
| List of int * type'
| Tuple of tuple_field list
and tuple_field = identifier * type'
and string_encoding =
| ASCII
| UTF8