diff --git a/parsetest.py b/parsetest.py index f500b8ed..21b9fee0 100644 --- a/parsetest.py +++ b/parsetest.py @@ -157,4 +157,4 @@ def globalfunc(): -c1().c3(1). +c1().c3(1) diff --git a/parsing.py b/parsing.py index 5ef60063..c93568a8 100644 --- a/parsing.py +++ b/parsing.py @@ -585,6 +585,10 @@ class Statement(Simple): # the token is a Name, which has already been parsed tok = tok_temp token_type = None + except ValueError: + debug.warning("unkown value, shouldn't happen", + tok_temp, type(tok_temp)) + raise else: if tok in ['return', 'yield'] or level == 0 and \ '=' in tok and not tok in ['>=', '<=', '==', '!=']: @@ -1137,9 +1141,9 @@ class PyFuzzyParser(object): # statement. This is a hack, but I could not come up # with a better solution. # 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) - tok_list = [tok] + tok_list = [self.current] set_vars = [] used_funcs = [] used_vars = [] diff --git a/test/completion/invalid.py b/test/completion/invalid.py new file mode 100644 index 00000000..993d332f --- /dev/null +++ b/test/completion/invalid.py @@ -0,0 +1,13 @@ +def openbrace(): + asdf = 3 + asdf + asdf( + return 1 + +#? ['real'] +openbrace().real + +blub([ +#? ['real'] +openbrace().real +