summaryrefslogtreecommitdiffstats
path: root/Python/Python-ast.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix a couple of problems in generating the AST code:Neal Norwitz2007-02-261-166/+56
| | | | | | * use %r instead of backticks since backticks are going away in Py3k * PyArena_Malloc() already sets PyErr_NoMemory so we don't need to do it again * the signature for ast2obj_int incorrectly used a bool, rather than a long
* Modify Parser/asdl_c.py so that the __version__ number for Python/Python-ast.cBrett Cannon2007-02-121-1/+10
| | | | | | is specified at the top of the file. Also add a note that Python/Python-ast.c needs to be committed separately after a change to the AST grammar to capture the revision number of the change (which is what __version__ is set to).
* Check in changed Python-ast.c from a cosmetic change to Python.asdl (inBrett Cannon2007-02-111-1/+1
| | | | r53731).
* Introduce asdl_int_seq, to hold cmpop_ty.Martin v. Löwis2006-04-131-3/+3
|
* Regenerate.Martin v. Löwis2006-04-111-2/+0
|
* Make _kind types global for C++ compilation.Martin v. Löwis2006-04-111-1/+1
| | | | Explicitly cast void* to int to cmpop_ty.
* low-hanging fruit in Python/ - g++ still hates all the enum_kind declarationsAnthony Baxter2006-04-111-0/+2
| | | | in Python/Python-ast.c. Not sure what to do about those.
* Regenerate.Martin v. Löwis2006-04-071-1/+1
|
* Add lineno, col_offset to excephandler to enable future fix forJeremy Hylton2006-04-041-3/+18
| | | | | | | | | | | | | | | tracing/line number table in except blocks. Reflow long lines introduced by col_offset changes. Update test_ast to handle new fields in excepthandler. As note in Python.asdl says, we might want to rethink how attributes are handled. Perhaps they should be the same as other fields, with the primary difference being how they are defined for all types within a sum. Also fix asdl_c so that constructors with int fields don't fail when passed a zero value.
* * Fix a refleak of *_attributes.Neal Norwitz2006-04-031-144/+146
| | | | | | * Cleanup formatting a bit (add spaces). * Move static var initialized inside init_types() since that's the only place it's used.
* Fix memory leak on attributes.Martin v. Löwis2006-03-021-5/+13
|
* Patch #1440601: Add col_offset attribute to AST nodes.Martin v. Löwis2006-03-011-51/+118
|
* Don't pollute namespace as bad as before. All the types are static now.Neal Norwitz2006-02-281-152/+152
|
* from __future__ import with_statement addon for 'with', mostly written byThomas Wouters2006-02-281-2/+2
| | | | Neal.
* SF patch #1438387, PEP 328: relative and absolute imports.Thomas Wouters2006-02-281-2/+10
| | | | | | | | | | | | | | | | | | | | | | | - IMPORT_NAME takes an extra argument from the stack: the relativeness of the import. Only passed to __import__ when it's not -1. - __import__() takes an optional 5th argument for the same thing; it __defaults to -1 (old semantics: try relative, then absolute) - 'from . import name' imports name (be it module or regular attribute) from the current module's *package*. Likewise, 'from .module import name' will import name from a sibling to the current module. - Importing from outside a package is not allowed; 'from . import sys' in a toplevel module will not work, nor will 'from .. import sys' in a (single-level) package. - 'from __future__ import absolute_import' will turn on the new semantics for import and from-import: imports will be absolute, except for from-import with dots. Includes tests for regular imports and importhooks, parser changes and a NEWS item, but no compiler-package changes or documentation changes.
* Regenerate.Martin v. Löwis2006-02-281-0/+2
|
* PEP 343 -- the with-statement.Guido van Rossum2006-02-271-0/+52
| | | | | | | | | | | | | This was started by Mike Bland and completed by Guido (with help from Neal). This still needs a __future__ statement added; Thomas is working on Michael's patch for that aspect. There's a small amount of code cleanup and refactoring in ast.c, compile.c and ceval.c (I fixed the lltrace behavior when EXT_POP is used -- however I had to make lltrace a static global).
* Create _ast module.Martin v. Löwis2006-02-271-29/+345
| | | | Cleanup Python-ast.c generation.
* PEP 308 implementation, including minor refdocs and some testcases. ItThomas Wouters2006-02-271-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | breaks the parser module, because it adds the if/else construct as well as two new grammar rules for backward compatibility. If no one else fixes parsermodule, I guess I'll go ahead and fix it later this week. The TeX code was checked with texcheck.py, but not rendered. There is actually a slight incompatibility: >>> (x for x in lambda:0) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: iteration over non-sequence changes into >>> (x for x in lambda: 0) File "<stdin>", line 1 (x for x in lambda: 0) ^ SyntaxError: invalid syntax Since there's no way the former version can be useful, it's probably a bugfix ;)
* Avoid reinitializing the types twice.Martin v. Löwis2006-02-271-0/+1
|
* Stop generating empty arrays.Martin v. Löwis2006-02-261-117/+38
|
* Fix iterating over cmpop_ty lists.Martin v. Löwis2006-02-261-2/+7
|
* Generate code to recursively copy an AST intoMartin v. Löwis2006-02-261-724/+1550
| | | | a tree of Python objects. Expose this through compile().
* Regenerate.Martin v. Löwis2006-01-021-45/+45
|
* Merge from ast-arena. This reduces the code in Python/ast.c by ~300 lines,Neal Norwitz2005-12-171-554/+113
| | | | simplifies a lot of error handling code, and fixes many memory leaks.
* SF #1373150, diffs in working copy after a buildNeal Norwitz2005-12-111-1/+1
| | | | | | | | Strip off leading dots and slash so the generated files are the same regardless of whether you configure in the checkout directory or build. If anyone configures in a different directory, we might want a cleaner approach using os.path.*(). Hopefully this is good enough.
* Whoops, checkin consistent versions of *all* files to stop pollutingNeal Norwitz2005-11-131-0/+74
| | | | a bunch of names
* Prevent name pollution by making lots of internal functions static.Neal Norwitz2005-11-131-14/+28
|
* Use PyErr_NoMemory() instead of rolling our own.Neal Norwitz2005-10-231-61/+54
| | | | Get rid of "int i" unused warnings from Python-ast.c which we are generating.
* Merge ast-branch to headJeremy Hylton2005-10-201-0/+2281
This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.