mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
invalid code testing
This commit is contained in:
@@ -157,4 +157,4 @@ def globalfunc():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
c1().c3(1).
|
c1().c3(1)
|
||||||
|
|||||||
@@ -585,6 +585,10 @@ class Statement(Simple):
|
|||||||
# the token is a Name, which has already been parsed
|
# the token is a Name, which has already been parsed
|
||||||
tok = tok_temp
|
tok = tok_temp
|
||||||
token_type = None
|
token_type = None
|
||||||
|
except ValueError:
|
||||||
|
debug.warning("unkown value, shouldn't happen",
|
||||||
|
tok_temp, type(tok_temp))
|
||||||
|
raise
|
||||||
else:
|
else:
|
||||||
if tok in ['return', 'yield'] or level == 0 and \
|
if tok in ['return', 'yield'] or level == 0 and \
|
||||||
'=' in tok and not tok in ['>=', '<=', '==', '!=']:
|
'=' in tok and not tok in ['>=', '<=', '==', '!=']:
|
||||||
@@ -1137,9 +1141,9 @@ class PyFuzzyParser(object):
|
|||||||
# statement. This is a hack, but I could not come up
|
# statement. This is a hack, but I could not come up
|
||||||
# with a better solution.
|
# with a better solution.
|
||||||
# This is basically a reset of the statement.
|
# This is basically a reset of the statement.
|
||||||
debug.warning('return in statement @%s', tok_list,
|
debug.warning('keyword in statement @%s', tok_list,
|
||||||
self.line_nr)
|
self.line_nr)
|
||||||
tok_list = [tok]
|
tok_list = [self.current]
|
||||||
set_vars = []
|
set_vars = []
|
||||||
used_funcs = []
|
used_funcs = []
|
||||||
used_vars = []
|
used_vars = []
|
||||||
|
|||||||
13
test/completion/invalid.py
Normal file
13
test/completion/invalid.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
def openbrace():
|
||||||
|
asdf = 3
|
||||||
|
asdf
|
||||||
|
asdf(
|
||||||
|
return 1
|
||||||
|
|
||||||
|
#? ['real']
|
||||||
|
openbrace().real
|
||||||
|
|
||||||
|
blub([
|
||||||
|
#? ['real']
|
||||||
|
openbrace().real
|
||||||
|
|
||||||
Reference in New Issue
Block a user