File tree Expand file tree Collapse file tree 3 files changed +774
-0
lines changed
Expand file tree Collapse file tree 3 files changed +774
-0
lines changed Original file line number Diff line number Diff line change 1+ package expr
2+
3+ // Node items of abstract syntax tree.
4+ type Node interface {}
5+
6+ type nilNode struct {}
7+
8+ type identifierNode struct {
9+ value string
10+ }
11+
12+ type numberNode struct {
13+ value float64
14+ }
15+
16+ type boolNode struct {
17+ value bool
18+ }
19+
20+ type textNode struct {
21+ value string
22+ }
23+
24+ type nameNode struct {
25+ name string
26+ }
27+
28+ type unaryNode struct {
29+ operator string
30+ node Node
31+ }
32+
33+ type binaryNode struct {
34+ operator string
35+ left Node
36+ right Node
37+ }
38+
39+ type propertyNode struct {
40+ node Node
41+ property Node
42+ }
43+
44+ type methodNode struct {
45+ node Node
46+ property identifierNode
47+ arguments []Node
48+ }
49+
50+ type functionNode struct {
51+ name string
52+ arguments []Node
53+ }
54+
55+ type conditionalNode struct {
56+ cond Node
57+ exp1 Node
58+ exp2 Node
59+ }
60+
61+ type arrayNode struct {
62+ nodes []Node
63+ }
64+
65+ type mapNode struct {
66+ pairs []pairNode
67+ }
68+
69+ type pairNode struct {
70+ key Node
71+ value Node
72+ }
You can’t perform that action at this time.
0 commit comments