We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c150ba2 commit 82b602aCopy full SHA for 82b602a
1 file changed
src/api/check.py
@@ -428,3 +428,14 @@ def is_ender(node) -> bool:
428
'CONTINUE_DO', 'CONTINUE_FOR', 'CONTINUE_WHILE',
429
'EXIT_DO', 'EXIT_FOR', 'EXIT_WHILE',
430
'GOTO', 'RETURN', 'STOP'}
431
+
432
433
+def check_class(node, class_: CLASS, lineno: int) -> bool:
434
+ """ Returns whether the given node has CLASS.unknown or the given class_.
435
+ It False, it will emit a syntax error
436
+ """
437
+ if node.class_ == CLASS.unknown or node.class_ == class_:
438
+ return True
439
440
+ errmsg.syntax_error_unexpected_class(lineno, node.name, node.class_, class_)
441
+ return False
0 commit comments