@@ -19,7 +19,7 @@ type ContextCheck struct {
19
19
continuestmt bool
20
20
}
21
21
22
- func RunStmtsCheck (ctx * Context , ctxCheck * ContextCheck , nodes ast.Stmts ) * errchain.PlError {
22
+ func RunStmtsCheck (ctx * Task , ctxCheck * ContextCheck , nodes ast.Stmts ) * errchain.PlError {
23
23
for _ , node := range nodes {
24
24
if err := RunStmtCheck (ctx , ctxCheck , node ); err != nil {
25
25
return err
@@ -28,7 +28,7 @@ func RunStmtsCheck(ctx *Context, ctxCheck *ContextCheck, nodes ast.Stmts) *errch
28
28
return nil
29
29
}
30
30
31
- func RunStmtCheck (ctx * Context , ctxCheck * ContextCheck , node * ast.Node ) * errchain.PlError {
31
+ func RunStmtCheck (ctx * Task , ctxCheck * ContextCheck , node * ast.Node ) * errchain.PlError {
32
32
if node == nil {
33
33
return nil
34
34
}
@@ -87,7 +87,7 @@ func RunStmtCheck(ctx *Context, ctxCheck *ContextCheck, node *ast.Node) *errchai
87
87
return nil
88
88
}
89
89
90
- func RunListInitExprCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.ListLiteral ) * errchain.PlError {
90
+ func RunListInitExprCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.ListLiteral ) * errchain.PlError {
91
91
for _ , v := range expr .List {
92
92
if err := RunStmtCheck (ctx , ctxCheck , v ); err != nil {
93
93
return err .ChainAppend (ctx .name , expr .LBracket )
@@ -96,7 +96,7 @@ func RunListInitExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.ListLi
96
96
return nil
97
97
}
98
98
99
- func RunMapInitExprCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.MapLiteral ) * errchain.PlError {
99
+ func RunMapInitExprCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.MapLiteral ) * errchain.PlError {
100
100
for _ , v := range expr .KeyValeList {
101
101
switch v [0 ].NodeType { //nolint:exhaustive
102
102
case ast .TypeFloatLiteral , ast .TypeIntegerLiteral ,
@@ -116,11 +116,11 @@ func RunMapInitExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.MapLite
116
116
return nil
117
117
}
118
118
119
- func RunParenExprCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.ParenExpr ) * errchain.PlError {
119
+ func RunParenExprCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.ParenExpr ) * errchain.PlError {
120
120
return RunStmtCheck (ctx , ctxCheck , expr .Param )
121
121
}
122
122
123
- func RunAttrExprCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.AttrExpr ) * errchain.PlError {
123
+ func RunAttrExprCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.AttrExpr ) * errchain.PlError {
124
124
if err := RunStmtCheck (ctx , ctxCheck , expr .Obj ); err != nil {
125
125
return err
126
126
}
@@ -131,7 +131,7 @@ func RunAttrExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.AttrExpr)
131
131
return nil
132
132
}
133
133
134
- func RunArithmeticExprCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.ArithmeticExpr ) * errchain.PlError {
134
+ func RunArithmeticExprCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.ArithmeticExpr ) * errchain.PlError {
135
135
if err := RunStmtCheck (ctx , ctxCheck , expr .LHS ); err != nil {
136
136
return err
137
137
}
@@ -145,7 +145,7 @@ func RunArithmeticExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.Arit
145
145
return nil
146
146
}
147
147
148
- func RunConditionExprCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.ConditionalExpr ) * errchain.PlError {
148
+ func RunConditionExprCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.ConditionalExpr ) * errchain.PlError {
149
149
if err := RunStmtCheck (ctx , ctxCheck , expr .LHS ); err != nil {
150
150
return err
151
151
}
@@ -155,14 +155,14 @@ func RunConditionExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.Condi
155
155
return nil
156
156
}
157
157
158
- func RunUnaryExprCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.UnaryExpr ) * errchain.PlError {
158
+ func RunUnaryExprCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.UnaryExpr ) * errchain.PlError {
159
159
if err := RunStmtCheck (ctx , ctxCheck , expr .RHS ); err != nil {
160
160
return err
161
161
}
162
162
return nil
163
163
}
164
164
165
- func RunIndexExprGetCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.IndexExpr ) * errchain.PlError {
165
+ func RunIndexExprGetCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.IndexExpr ) * errchain.PlError {
166
166
for _ , v := range expr .Index {
167
167
if err := RunStmtCheck (ctx , ctxCheck , v ); err != nil {
168
168
return err
@@ -171,7 +171,7 @@ func RunIndexExprGetCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.IndexE
171
171
return nil
172
172
}
173
173
174
- func RunCallExprCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.CallExpr ) * errchain.PlError {
174
+ func RunCallExprCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.CallExpr ) * errchain.PlError {
175
175
_ , ok := ctx .GetFuncCall (expr .Name )
176
176
if ! ok {
177
177
return NewRunError (ctx , fmt .Sprintf (
@@ -191,7 +191,7 @@ func RunCallExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.CallExpr)
191
191
return funcCheck (ctx , expr )
192
192
}
193
193
194
- func RunAssignmentExprCheck (ctx * Context , ctxCheck * ContextCheck , expr * ast.AssignmentExpr ) * errchain.PlError {
194
+ func RunAssignmentExprCheck (ctx * Task , ctxCheck * ContextCheck , expr * ast.AssignmentExpr ) * errchain.PlError {
195
195
if err := RunStmtCheck (ctx , ctxCheck , expr .RHS ); err != nil {
196
196
return err
197
197
}
@@ -201,7 +201,7 @@ func RunAssignmentExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.Assi
201
201
return nil
202
202
}
203
203
204
- func RunIfElseStmtCheck (ctx * Context , ctxCheck * ContextCheck , stmt * ast.IfelseStmt ) * errchain.PlError {
204
+ func RunIfElseStmtCheck (ctx * Task , ctxCheck * ContextCheck , stmt * ast.IfelseStmt ) * errchain.PlError {
205
205
ctx .StackEnterNew ()
206
206
defer ctx .StackExitCur ()
207
207
@@ -230,7 +230,7 @@ func RunIfElseStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.IfelseSt
230
230
return nil
231
231
}
232
232
233
- func RunForStmtCheck (ctx * Context , ctxCheck * ContextCheck , stmt * ast.ForStmt ) * errchain.PlError {
233
+ func RunForStmtCheck (ctx * Task , ctxCheck * ContextCheck , stmt * ast.ForStmt ) * errchain.PlError {
234
234
ctx .StackEnterNew ()
235
235
defer ctx .StackExitCur ()
236
236
@@ -268,7 +268,7 @@ func RunForStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.ForStmt) *e
268
268
return nil
269
269
}
270
270
271
- func RunForInStmtCheck (ctx * Context , ctxCheck * ContextCheck , stmt * ast.ForInStmt ) * errchain.PlError {
271
+ func RunForInStmtCheck (ctx * Task , ctxCheck * ContextCheck , stmt * ast.ForInStmt ) * errchain.PlError {
272
272
ctx .StackEnterNew ()
273
273
defer ctx .StackExitCur ()
274
274
@@ -303,15 +303,15 @@ func RunForInStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.ForInStmt
303
303
return nil
304
304
}
305
305
306
- func RunBreakStmtCheck (ctx * Context , ctxCheck * ContextCheck , stmt * ast.BreakStmt ) * errchain.PlError {
306
+ func RunBreakStmtCheck (ctx * Task , ctxCheck * ContextCheck , stmt * ast.BreakStmt ) * errchain.PlError {
307
307
if len (ctxCheck .forstmt ) == 0 {
308
308
return NewRunError (ctx , "break not in loop" , stmt .Start )
309
309
}
310
310
ctxCheck .breakstmt = true
311
311
return nil
312
312
}
313
313
314
- func RunContinueStmtCheck (ctx * Context , ctxCheck * ContextCheck , stmt * ast.ContinueStmt ) * errchain.PlError {
314
+ func RunContinueStmtCheck (ctx * Task , ctxCheck * ContextCheck , stmt * ast.ContinueStmt ) * errchain.PlError {
315
315
if len (ctxCheck .forstmt ) == 0 {
316
316
return NewRunError (ctx , "continue not in loop" , stmt .Start )
317
317
}
0 commit comments