mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +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()
|
stmt, tok = self._parse_statement()
|
||||||
if stmt is not None:
|
if stmt is not None:
|
||||||
stmt.parent = use_as_parent_scope
|
stmt.parent = use_as_parent_scope
|
||||||
self._scope.asserts.append(stmt)
|
self._scope.asserts.append(stmt)
|
||||||
# default
|
# default
|
||||||
elif token_type in [tokenize.NAME, tokenize.STRING,
|
elif token_type in [tokenize.NAME, tokenize.STRING,
|
||||||
tokenize.NUMBER] \
|
tokenize.NUMBER] \
|
||||||
|
|||||||
@@ -141,10 +141,16 @@ a[0]
|
|||||||
int()).
|
int()).
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# goto
|
# keywords
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|
||||||
#! []
|
#! []
|
||||||
as
|
as
|
||||||
|
|
||||||
|
def empty_assert():
|
||||||
|
x = 3
|
||||||
|
assert
|
||||||
|
#? int()
|
||||||
|
x
|
||||||
|
|
||||||
import datetime as
|
import datetime as
|
||||||
|
|||||||
Reference in New Issue
Block a user