1
0
forked from VimPlug/jedi

create KeywordStatement to fit assert, del, global, etc into a more generalized schema, which can also improve the get_code method

This commit is contained in:
Dave Halter
2014-03-04 15:35:24 +01:00
parent 65ce609a3c
commit 53fd1f925a
2 changed files with 29 additions and 1 deletions

View File

@@ -573,6 +573,11 @@ class Parser(object):
# add the global to the top, because there it is
# important.
self.module.add_global(t)
elif tok_str in STATEMENT_KEYWORDS:
stmt, _ = self._parse_statement()
k = pr.KeywordStatement(tok_str, tok.start_pos,
use_as_parent_scope, stmt)
self._scope.add_statement(k)
# decorator
elif tok_str == '@':
stmt, tok = self._parse_statement()