forked from mttsner/luautil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
expr.go
130 lines (94 loc) · 1.37 KB
/
expr.go
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
118
119
120
121
122
123
124
125
126
127
128
129
130
package ast
type Expr interface {
PositionHolder
exprMarker()
String() string
}
type ExprBase struct {
Node
}
func (expr *ExprBase) exprMarker() {}
/* ConstExprs {{{ */
type ConstExpr interface {
Expr
constExprMarker()
}
type ConstExprBase struct {
ExprBase
}
func (expr *ConstExprBase) constExprMarker() {}
type TrueExpr struct {
ConstExprBase
}
type FalseExpr struct {
ConstExprBase
}
type NilExpr struct {
ConstExprBase
}
type NumberExpr struct {
ConstExprBase
Value float64
}
type StringExpr struct {
ConstExprBase
Value string
}
/* ConstExprs }}} */
type Comma3Expr struct {
ExprBase
}
type IdentExpr struct {
ExprBase
Value string
}
type AttrGetExpr struct {
ExprBase
Object Expr
Key Expr
}
type TableExpr struct {
ExprBase
Fields []*Field
}
type FuncCallExpr struct {
ExprBase
Func Expr
Receiver Expr
Method string
Args []Expr
AdjustRet bool
}
type LogicalOpExpr struct {
ExprBase
Operator string
Lhs Expr
Rhs Expr
}
type RelationalOpExpr struct {
ExprBase
Operator string
Lhs Expr
Rhs Expr
}
type StringConcatOpExpr struct {
ExprBase
Lhs Expr
Rhs Expr
}
type ArithmeticOpExpr struct {
ExprBase
Operator string
Lhs Expr
Rhs Expr
}
type UnaryOpExpr struct {
ExprBase
Operator string
Expr Expr
}
type FunctionExpr struct {
ExprBase
ParList *ParList
Chunk Chunk
}