/
filter_op.gen.go
254 lines (207 loc) · 7.47 KB
/
filter_op.gen.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
// Code generated "gen_filter_op.go"; DO NOT EDIT.
package ir
const (
FilterInvalidOp FilterOp = 0
// !$Args[0]
FilterNotOp FilterOp = 1
// $Args[0] && $Args[1]
FilterAndOp FilterOp = 2
// $Args[0] || $Args[1]
FilterOrOp FilterOp = 3
// $Args[0] == $Args[1]
FilterEqOp FilterOp = 4
// $Args[0] != $Args[1]
FilterNeqOp FilterOp = 5
// $Args[0] > $Args[1]
FilterGtOp FilterOp = 6
// $Args[0] < $Args[1]
FilterLtOp FilterOp = 7
// $Args[0] >= $Args[1]
FilterGtEqOp FilterOp = 8
// $Args[0] <= $Args[1]
FilterLtEqOp FilterOp = 9
// m[$Value].Addressable
// $Value type: string
FilterVarAddressableOp FilterOp = 10
// m[$Value].Pure
// $Value type: string
FilterVarPureOp FilterOp = 11
// m[$Value].Const
// $Value type: string
FilterVarConstOp FilterOp = 12
// m[$Value].ConstSlice
// $Value type: string
FilterVarConstSliceOp FilterOp = 13
// m[$Value].Text
// $Value type: string
FilterVarTextOp FilterOp = 14
// m[$Value].Line
// $Value type: string
FilterVarLineOp FilterOp = 15
// m[$Value].Value.Int()
// $Value type: string
FilterVarValueIntOp FilterOp = 16
// m[$Value].Type.Size
// $Value type: string
FilterVarTypeSizeOp FilterOp = 17
// m[$Value].Type.HasPointers()
// $Value type: string
FilterVarTypeHasPointersOp FilterOp = 18
// m[$Value].Filter($Args[0])
// $Value type: string
FilterVarFilterOp FilterOp = 19
// m[$Value].Node.Is($Args[0])
// $Value type: string
FilterVarNodeIsOp FilterOp = 20
// m[$Value].Object.Is($Args[0])
// $Value type: string
FilterVarObjectIsOp FilterOp = 21
// m[$Value].Type.Is($Args[0])
// $Value type: string
FilterVarTypeIsOp FilterOp = 22
// m[$Value].Type.Underlying().Is($Args[0])
// $Value type: string
FilterVarTypeUnderlyingIsOp FilterOp = 23
// m[$Value].Type.OfKind($Args[0])
// $Value type: string
FilterVarTypeOfKindOp FilterOp = 24
// m[$Value].Type.Underlying().OfKind($Args[0])
// $Value type: string
FilterVarTypeUnderlyingOfKindOp FilterOp = 25
// m[$Value].Type.ConvertibleTo($Args[0])
// $Value type: string
FilterVarTypeConvertibleToOp FilterOp = 26
// m[$Value].Type.AssignableTo($Args[0])
// $Value type: string
FilterVarTypeAssignableToOp FilterOp = 27
// m[$Value].Type.Implements($Args[0])
// $Value type: string
FilterVarTypeImplementsOp FilterOp = 28
// m[$Value].Type.HasMethod($Args[0])
// $Value type: string
FilterVarTypeHasMethodOp FilterOp = 29
// m[$Value].Text.Matches($Args[0])
// $Value type: string
FilterVarTextMatchesOp FilterOp = 30
// m[$Value].Contains($Args[0])
// $Value type: string
FilterVarContainsOp FilterOp = 31
// m.Deadcode()
FilterDeadcodeOp FilterOp = 32
// m.GoVersion().Eq($Value)
// $Value type: string
FilterGoVersionEqOp FilterOp = 33
// m.GoVersion().LessThan($Value)
// $Value type: string
FilterGoVersionLessThanOp FilterOp = 34
// m.GoVersion().GreaterThan($Value)
// $Value type: string
FilterGoVersionGreaterThanOp FilterOp = 35
// m.GoVersion().LessEqThan($Value)
// $Value type: string
FilterGoVersionLessEqThanOp FilterOp = 36
// m.GoVersion().GreaterEqThan($Value)
// $Value type: string
FilterGoVersionGreaterEqThanOp FilterOp = 37
// m.File.Imports($Value)
// $Value type: string
FilterFileImportsOp FilterOp = 38
// m.File.PkgPath.Matches($Value)
// $Value type: string
FilterFilePkgPathMatchesOp FilterOp = 39
// m.File.Name.Matches($Value)
// $Value type: string
FilterFileNameMatchesOp FilterOp = 40
// $Value holds a function name
// $Value type: string
FilterFilterFuncRefOp FilterOp = 41
// $Value holds a string constant
// $Value type: string
FilterStringOp FilterOp = 42
// $Value holds an int64 constant
// $Value type: int64
FilterIntOp FilterOp = 43
// m[`$$`].Node.Parent().Is($Args[0])
FilterRootNodeParentIsOp FilterOp = 44
)
var filterOpNames = map[FilterOp]string{
FilterInvalidOp: `Invalid`,
FilterNotOp: `Not`,
FilterAndOp: `And`,
FilterOrOp: `Or`,
FilterEqOp: `Eq`,
FilterNeqOp: `Neq`,
FilterGtOp: `Gt`,
FilterLtOp: `Lt`,
FilterGtEqOp: `GtEq`,
FilterLtEqOp: `LtEq`,
FilterVarAddressableOp: `VarAddressable`,
FilterVarPureOp: `VarPure`,
FilterVarConstOp: `VarConst`,
FilterVarConstSliceOp: `VarConstSlice`,
FilterVarTextOp: `VarText`,
FilterVarLineOp: `VarLine`,
FilterVarValueIntOp: `VarValueInt`,
FilterVarTypeSizeOp: `VarTypeSize`,
FilterVarTypeHasPointersOp: `VarTypeHasPointers`,
FilterVarFilterOp: `VarFilter`,
FilterVarNodeIsOp: `VarNodeIs`,
FilterVarObjectIsOp: `VarObjectIs`,
FilterVarTypeIsOp: `VarTypeIs`,
FilterVarTypeUnderlyingIsOp: `VarTypeUnderlyingIs`,
FilterVarTypeOfKindOp: `VarTypeOfKind`,
FilterVarTypeUnderlyingOfKindOp: `VarTypeUnderlyingOfKind`,
FilterVarTypeConvertibleToOp: `VarTypeConvertibleTo`,
FilterVarTypeAssignableToOp: `VarTypeAssignableTo`,
FilterVarTypeImplementsOp: `VarTypeImplements`,
FilterVarTypeHasMethodOp: `VarTypeHasMethod`,
FilterVarTextMatchesOp: `VarTextMatches`,
FilterVarContainsOp: `VarContains`,
FilterDeadcodeOp: `Deadcode`,
FilterGoVersionEqOp: `GoVersionEq`,
FilterGoVersionLessThanOp: `GoVersionLessThan`,
FilterGoVersionGreaterThanOp: `GoVersionGreaterThan`,
FilterGoVersionLessEqThanOp: `GoVersionLessEqThan`,
FilterGoVersionGreaterEqThanOp: `GoVersionGreaterEqThan`,
FilterFileImportsOp: `FileImports`,
FilterFilePkgPathMatchesOp: `FilePkgPathMatches`,
FilterFileNameMatchesOp: `FileNameMatches`,
FilterFilterFuncRefOp: `FilterFuncRef`,
FilterStringOp: `String`,
FilterIntOp: `Int`,
FilterRootNodeParentIsOp: `RootNodeParentIs`,
}
var filterOpFlags = map[FilterOp]uint64{
FilterAndOp: flagIsBinaryExpr,
FilterOrOp: flagIsBinaryExpr,
FilterEqOp: flagIsBinaryExpr,
FilterNeqOp: flagIsBinaryExpr,
FilterGtOp: flagIsBinaryExpr,
FilterLtOp: flagIsBinaryExpr,
FilterGtEqOp: flagIsBinaryExpr,
FilterLtEqOp: flagIsBinaryExpr,
FilterVarAddressableOp: flagHasVar,
FilterVarPureOp: flagHasVar,
FilterVarConstOp: flagHasVar,
FilterVarConstSliceOp: flagHasVar,
FilterVarTextOp: flagHasVar,
FilterVarLineOp: flagHasVar,
FilterVarValueIntOp: flagHasVar,
FilterVarTypeSizeOp: flagHasVar,
FilterVarTypeHasPointersOp: flagHasVar,
FilterVarFilterOp: flagHasVar,
FilterVarNodeIsOp: flagHasVar,
FilterVarObjectIsOp: flagHasVar,
FilterVarTypeIsOp: flagHasVar,
FilterVarTypeUnderlyingIsOp: flagHasVar,
FilterVarTypeOfKindOp: flagHasVar,
FilterVarTypeUnderlyingOfKindOp: flagHasVar,
FilterVarTypeConvertibleToOp: flagHasVar,
FilterVarTypeAssignableToOp: flagHasVar,
FilterVarTypeImplementsOp: flagHasVar,
FilterVarTypeHasMethodOp: flagHasVar,
FilterVarTextMatchesOp: flagHasVar,
FilterVarContainsOp: flagHasVar,
FilterStringOp: flagIsBasicLit,
FilterIntOp: flagIsBasicLit,
}