mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
empty asserts should not lead to broken parsers
This commit is contained in:
@@ -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