summaryrefslogtreecommitdiff
path: root/rebuilder.py
Commit message (Collapse)AuthorAgeFilesLines
* Move all astroid modules into a its own directory, which is now the package.Torsten Marek2014-11-081-905/+0
| | | | python setup.py develop now works.
* Various speed improvements.Claudiu Popa2014-10-201-67/+11
|\ | | | | | | Patch by Alex Munroe.
| * merged with defaultEevee (Alex Munroe)2014-07-311-17/+42
| |\ | |/ |/|
| * Miscellaneous node rebuilder microoptimizations.Eevee (Alex Munroe)2014-07-011-1/+2
| |
| * Speed up rebuilder considerably by computing line numbers lazily.Eevee (Alex Munroe)2014-07-011-65/+9
| | | | | | | | | | | | | | Fetching the last child of each of hundreds of thousands of nodes is relatively expensive, and most of the time this information is never used, so don't actually figure it out until it's asked for. Saves the overhead of quite a few function calls, too.
* | pylint source codeSylvain Thénault2014-07-251-13/+18
| |
* | Cleanup.Claudiu Popa2014-07-131-10/+9
| |
* | Expose function annotation to astroid. `Arguments` node exposes ↵Claudiu Popa2014-07-131-4/+25
|/ | | | 'varargannotation', 'kwargannotation' and 'annotations' attributes, while `Function` node has the 'returns' attribute.
* Handle __metaclass__ defined at the module levelJulien Cristau2014-06-101-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | According to the doc (https://docs.python.org/2/reference/datamodel.html#customizing-class-creation): The appropriate metaclass is determined by the following precedence rules: - If dict['__metaclass__'] exists, it is used. - Otherwise, if there is at least one base class, its metaclass is used (this looks for a __class__ attribute first and if not found, uses its type). - Otherwise, if a global variable named __metaclass__ exists, it is used. - Otherwise, the old-style, classic metaclass (types.ClassType) is used. The third case was not handled by node.metaclass(). Remove metaclass lookup from the rebuilder, handle it all in Class._explicit_metaclass() instead, and use that in _newstyle_impl if possible. Remove test_newstyle_and_metaclass_bad, as I think the returned value in this test is irrelevant (it's a TypeError anyway, so you can't actually build that class), and replace it with a test using nested classes. Closes issue#33
* Function nodes can detect if they are decorated with subclasses of builtin ↵Claudiu Popa2014-05-071-4/+4
| | | | | | | descriptors when determining their type (`classmethod` and `staticmethod`). --HG-- branch : classmethod_subclasses
* call transformation for builtin modules as well (though not yet for their ↵Sylvain Thénault2014-03-191-19/+1
| | | | child nodes)
* Drop yield_from API, add a new YieldFrom node instead.Claudiu Popa2014-03-041-10/+10
| | | | | --HG-- branch : yield_from
* Add yield_from property for Yield nodes.Claudiu Popa2014-03-021-1/+3
| | | | | --HG-- branch : yield_from
* null commitClaudiu Popa2014-01-291-1/+1
| | | | | --HG-- branch : nameconstant_py34
* Proper handle args for Python 3.4 when adding to locals. Remove trailing ↵Claudiu Popa2014-01-271-18/+18
| | | | | | | whitespaces and bad indentation. --HG-- branch : nameconstant_py34
* vararg and kwarg are instances of _arg.arg for Python 3.4, not strings.Claudiu Popa2014-01-271-0/+8
| | | | | --HG-- branch : nameconstant_py34
* Merge with default.Claudiu Popa2014-01-261-7/+23
|\ | | | | | | | | --HG-- branch : nameconstant_py34
| * Simplify check, make sure that _newstyle is always checked for Python 3.Claudiu Popa2014-01-221-6/+6
| |
| * Make the compare only once.Claudiu Popa2014-01-161-1/+2
| |
| * All class nodes are marked as new style classes for Py3k, closes #12.Claudiu Popa2014-01-161-1/+4
| |
| * Proper metaclass discovery when encountering __metaclass__.Claudiu Popa2013-08-141-4/+8
| | | | | | | | | | --HG-- branch : metaclass
| * Change metaclass discovery.Claudiu Popa2013-08-131-10/+4
| | | | | | | | | | --HG-- branch : metaclass
| * Revert change.Claudiu Popa2013-07-241-1/+1
| |
| * Proper metaclass handling.Claudiu Popa2013-07-241-4/+3
| |
| * Add support for metaclass for Python 3.Claudiu Popa2013-07-241-1/+16
| |
* | Revert change.Claudiu Popa2013-12-161-0/+1
| | | | | | | | | | --HG-- branch : nameconstant_py34
* | Add support for ast NameConstant, added in Python 3.4.Claudiu Popa2013-12-161-1/+6
|/ | | | | --HG-- branch : nameconstant_py34
* Update some function definitions in py2stdlib's hashlib stub moduleTorsten Marek2013-07-241-1/+1
| | | | | | and make sure AST transforms without a predicate always match. Test all this in a new testcase.
* Add support for py3k's keyword only argumentsJulien Cristau2013-07-181-0/+10
| | | | PEP 3102
* Handle python3.3's With nodesJulien Cristau2013-06-201-4/+28
| | | | | Change With nodes to have a list of (expr, var) items as in python 3.3's ast.
* rebuilder: fix handling of python3.3's Try ast nodesJulien Cristau2013-06-191-4/+4
| | | | | We were setting the wrong parents, which upset pylint. Fixes https://bitbucket.org/logilab/pylint/issue/10/pylint-028-throws-an-exception-after
* [transforms] allow transformation functions on any nodes, not only modulesSylvain Thénault2013-06-181-4/+25
|
* [rebuilder] visit_module is a particular visit function (main entry point), ↵Sylvain Thénault2013-06-181-10/+10
| | | | move it on top
* work on thread safetySylvain Thénault2013-06-181-4/+1
| | | | to start with, rebuilder should not be a class attribute
* rebuilder: set tolineno for 'except' blocks on python 3.3Julien Cristau2013-06-171-0/+1
| | | | | | | The rewriting of Try node into TryFinally+TryExcept wasn't setting the end line for the except block. Fixes test_block_range.
* rename the project astroidDavid Douard2013-06-171-12/+12
|
* import cleanupsSylvain Thénault2013-03-291-1/+0
| | | | | --HG-- branch : stable
* [py3.3] don't crash on 'yield from' nodes. Closes #124360Sylvain Thénault2013-03-271-0/+2
| | | | | --HG-- branch : stable
* Set literals should be treated as inference leaves. Closes #47957Torsten Marek2013-03-271-1/+1
| | | | | --HG-- branch : stable
* fixes for python 3.3 ast nodes changes. Closes #120646Sylvain Thénault2013-02-221-7/+29
|
* test and fix absolute import handling. Closes #106191Sylvain Thénault2012-10-051-1/+1
| | | | | --HG-- branch : stable
* closes #77188: support lgc.decorators.classpropertySylvain Thénault2011-09-271-3/+7
|
* cosmetic changes: update/fix copyright and comments, d-t-wSylvain Thénault2011-09-271-12/+0
|
* closes #69217: please add column offset to the astng nodeSylvain Thénault2011-06-161-0/+4
|
* performance : a little cash for visit methodsEmile Anclin2010-12-141-4/+12
| | | | | remember that visit is called tousands of time for each module; remove print from a test
* fix #52006: "True" and "False" can be assignedEmile Anclin2010-12-091-5/+8
| | | | another fix: yield can yield nothing
* refactoring for tree rebuildingEmile Anclin2010-12-091-33/+3
| | | | | | | | | rebuilder: move all post build process to builder and don't depend on manager builder: - instanciate ASTNGBuilder's ASTNGManager and TreeRebuilder only once - cleanup build methods; - "_data_build" should become entry point for possible astng pickle cache
* py3k: fix some obvious stuffEmile Anclin2010-12-021-1/+2
|
* reduce circular imports I: import exceptions directlyEmile Anclin2010-12-021-1/+1
| | | | - rename exceptions module: it's exported to Pylint anyway
* cleanup: rebuilder: test None values only in known casesEmile Anclin2010-12-011-25/+40
|