Skip to content

Commit

Permalink
Add an ast module.
Browse files Browse the repository at this point in the history
The ast module mirrors the Python's builtin ast module, but adds
location information. Specifically, in the same way that the builtin
module describes the semantic fields, it adds a class field _locs
containing the name of the fields containing location data.

Additionally, this module contains documentation, describing
just what the semantic (and location) fields contain.

The ast module currently targets 2.6-2.7, with shim infrastructure
to be later extended up to 3.5.
whitequark committed Apr 23, 2015
1 parent 23e26dd commit 09e9545
Showing 4 changed files with 653 additions and 1 deletion.
24 changes: 23 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
@@ -21,8 +21,30 @@ for every token.
:show-inheritance:

:mod:`lexer` Module
--------------------
-------------------

.. automodule:: pyparser.lexer
:members:
:show-inheritance:

:mod:`ast` Module
-----------------

.. automodule:: pyparser.ast
:members: commonloc, beginendloc, keywordloc,
alias,
arguments,
boolop, And, Or,
cmpop, Eq, Gt, GtE, In, Is, IsNot, Lt, LtE, NotEq, NotIn,
comprehension,
expr, BinOp, BoolOp, Call, Compare, Dict, DictComp, GeneratorExp, IfExp, Lambda,
List, ListComp, Name, Num, Repr, Set, SetComp, Str, Subscript, Tuple, UnaryOp, Yield,
keyword,
mod, Expression, Interactive, Module, Suite,
operator, Add, BitAnd, BitOr, BitXor, Div, FloorDiv, LShift, Mod, Mult, Pow, RShift, Sub,
slice, Ellipsis, ExtSlice, Index, Slice,
stmt, Assert, Assign, AugAssign, Break, ClassDef, Continue, Delete, Exec, Expr, For,
FunctionDef, Global, If, Import, ImportFrom, Pass, Print, Raise, Return, TryExcept,
TryFinally, While, With,
unaryop, Invert, Not, UAdd, USub
:show-inheritance:
Loading

0 comments on commit 09e9545

Please sign in to comment.