1
0
forked from VimPlug/jedi

header description of the parser

This commit is contained in:
David Halter
2012-02-29 23:11:53 +01:00
parent 0e03c61e30
commit 2c1108db1c

View File

@@ -1,22 +1,40 @@
""""
TODO Description: This is a parser
"""
Maintainer: David Halter <davidhalter88@gmail.com>
Version: 0.1
py_fuzzyparser parses python code, with the goal of a good representation of
the code within a tree structure. Variables, Classes and Functions are defined
within this tree structure, containing their exact locations in the code.
It is also a primary goal to work with code which contains syntax errors.
This behaviour may be used to refactor, modify, search and complete code.
To understand this code it is extremely important to understand the behaviour
of the python module 'tokenize'.
This original codebase of this parser, which has been refactored and heavily
changed, was programmed by Aaron Griffin <aaronmgriffin@gmail.com>.
*The structure of the following script:*
A Scope has
- imports (Import)
- subscopes (Scope, Class, Function, Flow)
- statements (Statement)
All those classes are being generated by PyFuzzyParser, which takes python text
as input.
Ignored statements:
- print (no use for it, just slows down)
- exec (dangerous - not controllable)
TODO be tolerant with indents
TODO dictionaries not working with statement parser
TODO except has local vars
TODO take special care for future imports
TODO add global statements
scope
imports
subscopes
statements
Ignored statements:
- print (no use for it)
- exec (dangerous - not controllable)
"""
import sys
import tokenize
import cStringIO