diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2010-04-16 17:44:03 +0200 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2010-04-16 17:44:03 +0200 |
commit | 76ec3fb4f732c17a37e2ece518fa877aeaa790bc (patch) | |
tree | 94ffb4ab50e2ca531b2f5ad72e7057a02f48f3d4 /rebuilder.py | |
parent | 6e2588643722fe48e81ae32016414aa023e68146 (diff) | |
download | astroid-git-76ec3fb4f732c17a37e2ece518fa877aeaa790bc.tar.gz |
nodes redirection cleanup possible since refactoring
Diffstat (limited to 'rebuilder.py')
-rw-r--r-- | rebuilder.py | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/rebuilder.py b/rebuilder.py index 71276f2d..eb6495ad 100644 --- a/rebuilder.py +++ b/rebuilder.py @@ -22,9 +22,45 @@ order to get a single ASTNG representation from logilab.astng import ASTNGBuildingException, InferenceError from logilab.astng import nodes -from logilab.astng.utils import REDIRECT from logilab.astng.bases import YES, Instance +REDIRECT = {'arguments': 'Arguments', + 'Attribute': 'Getattr', + 'comprehension': 'Comprehension', + 'Call': 'CallFunc', + 'ClassDef': 'Class', + "ListCompFor": 'Comprehension', + "GenExprFor": 'Comprehension', + 'excepthandler': 'ExceptHandler', + 'Expr': 'Discard', + 'FunctionDef': 'Function', + 'GeneratorExp': 'GenExpr', + 'ImportFrom': 'From', + 'keyword': 'Keyword', + 'Repr': 'Backquote', + + 'Add': 'BinOp', + 'Bitand': 'BinOp', + 'Bitor': 'BinOp', + 'Bitxor': 'BinOp', + 'Div': 'BinOp', + 'FloorDiv': 'BinOp', + 'LeftShift': 'BinOp', + 'Mod': 'BinOp', + 'Mul': 'BinOp', + 'Power': 'BinOp', + 'RightShift': 'BinOp', + 'Sub': 'BinOp', + + 'And': 'BoolOp', + 'Or': 'BoolOp', + + 'UnaryAdd': 'UnaryOp', + 'UnarySub': 'UnaryOp', + 'Not': 'UnaryOp', + 'Invert': 'UnaryOp' + } + class RebuildVisitor(object): """Visitor to transform an AST to an ASTNG |