File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -293,17 +293,22 @@ def _check_if(cond: Union[str, object]) -> None:
293
293
info ,
294
294
"'if' condition of %s has conflicting keys" % source )
295
295
296
- oper , operands = next (iter (cond .items ()))
296
+ if 'not' in cond :
297
+ _check_if (cond ['not' ])
298
+ elif 'all' in cond :
299
+ _check_infix ('all' , cond ['all' ])
300
+ else :
301
+ _check_infix ('any' , cond ['any' ])
302
+
303
+ def _check_infix (operator : str , operands : object ) -> None :
304
+ if not isinstance (operands , list ):
305
+ raise QAPISemError (
306
+ info ,
307
+ "'%s' condition of %s must be an array"
308
+ % (operator , source ))
297
309
if not operands :
298
310
raise QAPISemError (
299
311
info , "'if' condition [] of %s is useless" % source )
300
-
301
- if oper == "not" :
302
- _check_if (operands )
303
- return
304
- if oper in ("all" , "any" ) and not isinstance (operands , list ):
305
- raise QAPISemError (
306
- info , "'%s' condition of %s must be an array" % (oper , source ))
307
312
for operand in operands :
308
313
_check_if (operand )
309
314
Original file line number Diff line number Diff line change 1
1
bad-if-not.json: In struct 'TestIfStruct':
2
- bad-if-not.json:2: 'if' condition [] of struct is useless
2
+ bad-if-not.json:2: 'if' condition '' of struct is not a valid identifier
You can’t perform that action at this time.
0 commit comments