Commit 0352173c authored by Sven Brauch's avatar Sven Brauch

update design, todo

parent 741c1a15
......@@ -20,23 +20,7 @@ It should be obvious from the large amount of examples what those rules look lik
This class returns a CodeAst, which is then passed back to the parse job, which then calls
the DUChain classes to analyze the tree. If an error occurs, parsing is aborted and the error is
reported to the user.
As the standard python AST library obfuscates some ranges (like, in, all of foo, bar and baz are
said to start at column 0, while we need to know bar starts at 4 and baz at 8), we had no choice than to fork
the python parser and make those changes ourselves. The python source code can be found in the python-src
directory. The patches which were applied to the parser are in the patches/ subdirectory in git patch format;
those can be used if we want to switch the python version one day (from python 2.7 to 3.x, for example).
The DUChain Library
This library builds a Definition-Use-Chain from the AST, which is then used to
support code completion, syntax highlighting and other language features in
KDevelop. The design of the DUChain is described at:
The following language elements create a new Context:
- a class definition
- a function definition
- a compound statement, that includes for, while, if, with statements <- this has been removed,
as those do not really create a new context in the python language (i.e. variable declarations
inside such "contexts" still exist outside, unlike C++)
\ No newline at end of file
- Support "from ... import *"
- fix function argument calltip (currently implemented incorrectly)
- write debugger interface
- use PYTHONPATH for searching includes
- add C module template
- add a lot of error reporting
- support unsure types in autocompletion / highlighting
A note from David Nolden(one of the authors of C++ Language support):
[2007-09-04 23:38] <dnolden> apaku: Btw. I have thought a bit about python code-completion. I think to make it really good, you need the following:
[2007-09-04 23:38] <dnolden> 1. An expression-parser, that is able to determine the type of any python expression (maybe could be integrated in type-builder)
[2007-09-04 23:39] <dnolden> 2. A specialized PythonDeclaration class that can hold an arbitrarily sized list of types
[2007-09-04 23:39] <dnolden> 3. Whenever assigning something to a value, evaluate that somethings type, and add it to the declarations type-list
[2007-09-04 23:40] <dnolden> However expression-parsing was a lot of work for c++, I don't know how much it would be for python
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment