parser tree docstring updates.

This commit is contained in:
Dave Halter
2014-12-16 18:10:28 +01:00
parent f702a91813
commit 5730e5add0
2 changed files with 9 additions and 13 deletions
+1
View File
@@ -626,6 +626,7 @@ class FunctionExecution(Executed):
return LazyDict(self.base.names_dict, self._copy_list) return LazyDict(self.base.names_dict, self._copy_list)
""" """
@memoize_default(default=NO_DEFAULT) @memoize_default(default=NO_DEFAULT)
def _get_params(self): def _get_params(self):
""" """
+8 -13
View File
@@ -1,19 +1,14 @@
""" """
If you know what an abstract syntax tree (ast) is, you'll see that this module If you know what an abstract syntax tree (AST) is, you'll see that this module
is pretty much that. The classes represent syntax elements: ``Import``, is pretty much that. The classes represent syntax elements like functions and
``Function``. imports.
A very central class is ``Scope``. It is not used directly by the parser, but This is the "business logic" part of the parser. There's a lot of logic here
inherited. It's used by ``Function``, ``Class``, ``Flow``, etc. A ``Scope`` may that makes it easier for Jedi (and other libraries to deal with a Python syntax
have ``subscopes``, ``imports`` and ``statements``. The entire parser is based tree.
on scopes, because they also stand for indentation.
One special thing: By using `get_code` on a module, you can get back the 1-to-1 representation of
the input given to the parser. This is important if you are using refactoring.
``Array`` values are statements. But if you think about it, this makes sense.
``[1, 2+33]`` for example would be an Array with two ``Statement`` inside. This
is the easiest way to write a parser. The same behaviour applies to ``Param``,
which is being used in a function definition.
The easiest way to play with this module is to use :class:`parsing.Parser`. The easiest way to play with this module is to use :class:`parsing.Parser`.
:attr:`parsing.Parser.module` holds an instance of :class:`SubModule`: :attr:`parsing.Parser.module` holds an instance of :class:`SubModule`: