empty asserts should not lead to broken parsers
This commit is contained in:
1 parent
af7089b8ca
commit
230bf724a2
2 files changed
+8
-2
No files matched your search
+1
-1
@@ -665,7 +665,7 @@ class Parser(object):
|
||||
stmt, tok = self._parse_statement()
|
||||
if stmt is not None:
|
||||
stmt.parent = use_as_parent_scope
|
||||
self._scope.asserts.append(stmt)
|
||||
self._scope.asserts.append(stmt)
|
||||
# default
|
||||
elif token_type in [tokenize.NAME, tokenize.STRING,
|
||||
tokenize.NUMBER] \
|
||||
|
||||
@@ -141,10 +141,16 @@ a[0]
|
||||
int()).
|
||||
|
||||
# -----------------
|
||||
# goto
|
||||
# keywords
|
||||
# -----------------
|
||||
|
||||
#! []
|
||||
as
|
||||
|
||||
def empty_assert():
|
||||
x = 3
|
||||
assert
|
||||
#? int()
|
||||
x
|
||||
|
||||
import datetime as
|
||||
Reference in new issue
Block a user