temporary solution for completions in asserts

This commit is contained in:
Dave Halter
2014-06-22 11:27:28 +02:00
parent ddca14980e
commit d752907290
3 changed files with 12 additions and 0 deletions

View File

@@ -566,6 +566,7 @@ class Parser(object):
stmt, tok = self._parse_statement()
if stmt is not None:
stmt.parent = use_as_parent_scope
self._scope.statements.append(stmt)
self._scope.asserts.append(stmt)
elif tok_str in STATEMENT_KEYWORDS:
stmt, _ = self._parse_statement()

View File

@@ -820,6 +820,9 @@ class KeywordStatement(Base):
if stmt is not None:
stmt.parent = self
def is_scope(self):
return False
def __repr__(self):
return "<%s(%s): %s>" % (type(self).__name__, self.name, self.stmt)

View File

@@ -43,6 +43,14 @@ def func():
#? int() str()
func()
# -----------------
# keywords
# -----------------
#? list()
assert []
# -----------------
# for loops
# -----------------