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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
type literal =
| Bool of bool
| String of string
| Number of float
| Null
[@@deriving show { with_path = false }]
type builtin = Add | Absolute [@@deriving show { with_path = false }]
type op =
| Add
| Subtract
| Multiply
| Divide
| Modulo
| Equal
| Not_equal
| Greater_than
| Less_than
| Greater_than_or_equal
| Less_than_or_equal
| And
| Or
[@@deriving show { with_path = false }]
type expression =
| Identity
| Empty
| Pipe of expression * expression
| Comma of expression * expression
| Literal of literal
| List of expression list
| Object of (expression * expression option) list
| Walk of expression
| Transpose of expression
| Key of string
| Optional of expression
| Has of expression
| Keys
| Floor
| Sqrt
| Type
| Sort
| Min
| Max
| Unique
| Reverse
| Explode
| Implode
| Any
| All
| In of expression
| Recurse
| Recurse_with of expression * expression
| Recurse_down
| To_entries
| To_string
| Tostring
| From_entries
| With_entries
| Nan
| Is_nan
| Index of int list
| Iterator
| Range of int * int option * int option
| Flatten of int option
| Head
| Tail
| Map of expression
| Slice of int option * int option
| Flat_map of expression
| Reduce of expression
| Select of expression
| Sort_by of expression
| Group_by of expression
| Unique_by of expression
| Min_by of expression
| Max_by of expression
| All_with_condition of expression
| Any_with_condition of expression
| Some_ of expression
| Find of expression
| Operation of expression * op * expression
| Length
| Contains of expression
| Test of string
| To_number
| Tonumber
| Starts_with of expression
| Startwith of expression
| Ends_with of expression
| Endwith of expression
| Index_of of expression
| Rindex_of of expression
| Split of expression
| Join of expression
| Path of expression
| If_then_else of
expression * expression * expression
| While of expression * expression
| Until of expression * expression
| Break
| Not
| Fun of builtin
[@@deriving show { with_path = false }]