| OLD | NEW |
| (Empty) |
| 1 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. | |
| 2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr | |
| 3 # | |
| 4 # This file is part of astroid. | |
| 5 # | |
| 6 # astroid is free software: you can redistribute it and/or modify it | |
| 7 # under the terms of the GNU Lesser General Public License as published by the | |
| 8 # Free Software Foundation, either version 2.1 of the License, or (at your | |
| 9 # option) any later version. | |
| 10 # | |
| 11 # astroid is distributed in the hope that it will be useful, but | |
| 12 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | |
| 14 # for more details. | |
| 15 # | |
| 16 # You should have received a copy of the GNU Lesser General Public License along | |
| 17 # with astroid. If not, see <http://www.gnu.org/licenses/>. | |
| 18 """ | |
| 19 on all nodes : | |
| 20 .is_statement, returning true if the node should be considered as a | |
| 21 statement node | |
| 22 .root(), returning the root node of the tree (i.e. a Module) | |
| 23 .previous_sibling(), returning previous sibling statement node | |
| 24 .next_sibling(), returning next sibling statement node | |
| 25 .statement(), returning the first parent node marked as statement node | |
| 26 .frame(), returning the first node defining a new local scope (i.e. | |
| 27 Module, Function or Class) | |
| 28 .set_local(name, node), define an identifier <name> on the first parent frame, | |
| 29 with the node defining it. This is used by the astroid builder and should not | |
| 30 be used from out there. | |
| 31 | |
| 32 on From and Import : | |
| 33 .real_name(name), | |
| 34 | |
| 35 | |
| 36 """ | |
| 37 | |
| 38 __docformat__ = "restructuredtext en" | |
| 39 | |
| 40 from astroid.node_classes import Arguments, AssAttr, Assert, Assign, \ | |
| 41 AssName, AugAssign, Backquote, BinOp, BoolOp, Break, CallFunc, Compare, \ | |
| 42 Comprehension, Const, Continue, Decorators, DelAttr, DelName, Delete, \ | |
| 43 Dict, Discard, Ellipsis, EmptyNode, ExceptHandler, Exec, ExtSlice, For, \ | |
| 44 From, Getattr, Global, If, IfExp, Import, Index, Keyword, \ | |
| 45 List, Name, Nonlocal, Pass, Print, Raise, Return, Set, Slice, Starred, Subsc
ript, \ | |
| 46 TryExcept, TryFinally, Tuple, UnaryOp, While, With, Yield, YieldFrom, \ | |
| 47 const_factory | |
| 48 from astroid.scoped_nodes import Module, GenExpr, Lambda, DictComp, \ | |
| 49 ListComp, SetComp, Function, Class | |
| 50 | |
| 51 ALL_NODE_CLASSES = ( | |
| 52 Arguments, AssAttr, Assert, Assign, AssName, AugAssign, | |
| 53 Backquote, BinOp, BoolOp, Break, | |
| 54 CallFunc, Class, Compare, Comprehension, Const, Continue, | |
| 55 Decorators, DelAttr, DelName, Delete, | |
| 56 Dict, DictComp, Discard, | |
| 57 Ellipsis, EmptyNode, ExceptHandler, Exec, ExtSlice, | |
| 58 For, From, Function, | |
| 59 Getattr, GenExpr, Global, | |
| 60 If, IfExp, Import, Index, | |
| 61 Keyword, | |
| 62 Lambda, List, ListComp, | |
| 63 Name, Nonlocal, | |
| 64 Module, | |
| 65 Pass, Print, | |
| 66 Raise, Return, | |
| 67 Set, SetComp, Slice, Starred, Subscript, | |
| 68 TryExcept, TryFinally, Tuple, | |
| 69 UnaryOp, | |
| 70 While, With, | |
| 71 Yield, YieldFrom | |
| 72 ) | |
| 73 | |
| OLD | NEW |