From 6d2d23cd78d77bc5b9888b9eb9d67ccdb4ec95d4 Mon Sep 17 00:00:00 2001 From: David Halter Date: Thu, 7 Feb 2013 18:19:22 +0100 Subject: [PATCH] docstring update for parsing_representation --- jedi/parsing_representation.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/jedi/parsing_representation.py b/jedi/parsing_representation.py index ff2d04af..2b2757ed 100644 --- a/jedi/parsing_representation.py +++ b/jedi/parsing_representation.py @@ -8,13 +8,12 @@ inherited. It's used by ``Function``, ``Class``, ``Flow``, etc. A ``Scope`` may have ``subscopes``, ``imports`` and ``statements``. The entire parser is based on scopes, because they also stand for indentation. -One strange thing about the parser is that ``Array`` is two dimensional. This -has been caused by the fact that each array element can be defined by -operations: ``[1, 2+33]``. So I chose to use a second dimension for ``2+33``, -where each element would lie in the array like this: ``[2, '+', 33]``. In the -future it might be useful to use Statements there, too (remove those crappy two -dimensional arrays). This is also how ``Param`` works. Every single ``Param`` -is a ``Statement``. +One special thing: + +``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. .. todo:: remove docstr params from Scope.__init__()