forked from VimPlug/jedi
Remove the module attribute from the parser.
This commit is contained in:
@@ -197,7 +197,6 @@ class ParserWithRecovery(Parser):
|
||||
def parse(self, tokenizer):
|
||||
root_node = super(ParserWithRecovery, self).parse(self._tokenize(tokenizer))
|
||||
root_node.path = self._module_path
|
||||
self.module = root_node
|
||||
return root_node
|
||||
|
||||
def error_recovery(self, grammar, stack, arcs, typ, value, start_pos, prefix,
|
||||
|
||||
@@ -16,14 +16,14 @@ The easiest way to play with this module is to use :class:`parsing.Parser`.
|
||||
>>> from jedi.parser.python import load_grammar
|
||||
>>> from jedi.parser import ParserWithRecovery
|
||||
>>> parser = ParserWithRecovery(load_grammar(), u('import os'), 'example.py')
|
||||
>>> submodule = parser.module
|
||||
>>> submodule
|
||||
>>> module = parser.get_root_node()
|
||||
>>> module
|
||||
<Module: example.py@1-1>
|
||||
|
||||
Any subclasses of :class:`Scope`, including :class:`Module` has an attribute
|
||||
:attr:`imports <Scope.imports>`:
|
||||
|
||||
>>> submodule.imports
|
||||
>>> module.imports
|
||||
[<ImportName: import os@1,0>]
|
||||
|
||||
See also :attr:`Scope.subscopes` and :attr:`Scope.statements`.
|
||||
|
||||
Reference in New Issue
Block a user