summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
Commit message (Collapse)AuthorAgeFilesLines
* Added bytes and b'' as aliases for str and ''Christian Heimes2008-01-181-0/+3
|
* Make Python compile with --disable-unicode.Georg Brandl2008-01-071-0/+2
|
* Added filename to compiling struct based on Martin's suggestion.Christian Heimes2007-11-241-1/+3
| | | | I'm wonder why I was trying to add the filename to the node all the time. The compiling struct is more obvious.
* And yet another fix for the patch. Paul Moore has send me a note that I've ↵Christian Heimes2007-11-231-8/+9
| | | | missed a declaration. The additional code has moved the declaration in the middle of the block.
* How did the comment get there?Christian Heimes2007-11-231-1/+1
|
* Fixed problems in the last commit. Filenames and line numbers weren't ↵Christian Heimes2007-11-231-4/+8
| | | | | | reported correctly. Backquotes still don't report the correct file. The AST nodes only contain the line number but not the file name.
* Applied patch #1754273 and #1754271 from Thomas GleeChristian Heimes2007-11-231-0/+4
| | | | The patches are adding deprecation warnings for back ticks and <>
* Fix Coverity #158: Check the correct variable.Neal Norwitz2007-10-051-1/+1
|
* Place #ifdef Py_USING_UNICODE around decode_unicode().Georg Brandl2007-08-061-0/+2
|
* SF patch# 1755885 by Kurt Kaiser: show location of Unicode escape errors.Guido van Rossum2007-07-181-2/+19
| | | | (Slightly tweaked for style and refcounts.)
* Disallow function calls like foo(None=1).Georg Brandl2007-06-071-0/+4
| | | | Backport from py3k rev. 55708 by Guido.
* Backport PEP 3110's new 'except' syntax to 2.6.Collin Winter2007-05-181-1/+1
|
* Handle a couple of uncaught errors. This should be backportedNeal Norwitz2007-05-031-0/+4
|
* Actually raise an exception before calling ast_error_finish.Georg Brandl2007-05-021-0/+2
| | | | Triggers an assertion otherwise.
* Clean up formatting of this file.Jeremy Hylton2007-03-161-2029/+2048
| | | | | | | | | | The file should now follow PEP 7, except that it uses 4 space indents (in the style of Py3k). This particular code would be really hard to read with the regular tab idents. Other changes: - reflow long lines - change multi-line conditionals to have test at end of line
* Patch #1642547: Fix an error/crash when encountering syntax errors in ↵Collin Winter2007-03-161-14/+26
| | | | | | complex if statements. Will backport.
* tabifyJeremy Hylton2007-02-271-2005/+2005
| | | | | Note that ast.c still has a mix of tabs and spaces, because it attempts to use four-space indents for more of the new code.
* Bug #1588287: fix invalid assertion for `1,2` in debug builds.Neal Norwitz2006-11-041-0/+1
| | | | Will backport
* Bug #1557232: fix seg fault with def f((((x)))) and def f(((x),)).Neal Norwitz2006-09-221-2/+24
| | | | | | | These tests should be improved. Hopefully this fixes variations when flipping back and forth between fpdef and fplist. Backport candidate.
* with and as are now keywords. There are some generated files I can't recreate.Neal Norwitz2006-09-061-12/+0
|
* M-x untabifyNeal Norwitz2006-09-051-821/+821
|
* Add a comment about some refactoring. (There's probably more that should be ↵Neal Norwitz2006-09-051-6/+5
| | | | done.) I will reformat this file in the next checkin due to the inconsistent tabs/spaces.
* Bug #1520864 (again): unpacking singleton tuples in list comprehensions andNeal Norwitz2006-09-051-4/+12
| | | | | | | | | | | | | generator expressions (x for x, in ... ) works again. Sigh, I only fixed for loops the first time, not list comps and genexprs too. I couldn't find any more unpacking cases where there is a similar bug lurking. This code should be refactored to eliminate the duplication. I'm sure the listcomp/genexpr code can be refactored. I'm not sure if the for loop can re-use any of the same code though. Will backport to 2.5 (the only place it matters).
* Klocwork made another run and found a bunch more problems.Neal Norwitz2006-08-121-0/+2
| | | | | | | This is the first batch of fixes that should be easy to verify based on context. This fixes problem numbers: 220 (ast), 323-324 (symtable), 321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree).
* Add some asserts and update commentsNeal Norwitz2006-07-301-2/+3
|
* Patch #1531113: Fix augmented assignment with yield expressions.Neal Norwitz2006-07-301-7/+9
| | | | Also fix a SystemError when trying to assign to yield expressions.
* Handle more memory allocation failures without crashing.Neal Norwitz2006-07-211-2/+4
|
* Bug #1520864: unpacking singleton tuples in for loop (for x, in) work again.Neal Norwitz2006-07-121-2/+6
|
* Fix SF bug 1441486: bad unary minus folding in compiler.Neil Schemenauer2006-07-091-20/+53
|
* Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.Neil Schemenauer2006-07-091-2/+3
|
* Fix SF bug #1519018: 'as' is now validated properly in import statementsNeal Norwitz2006-07-081-1/+12
|
* Replace Py_BuildValue("OO") by PyTuple_Pack.Georg Brandl2006-05-261-1/+1
|
* Fix #1474677, non-keyword argument following keyword.Neal Norwitz2006-05-191-0/+5
|
* - Bug #1487966: Fix SystemError with conditional expression in assignmentNeal Norwitz2006-05-151-0/+3
| | | | Most of the test_syntax changes are just updating the numbers.
* Fix more ssize_t issues.Martin v. Löwis2006-04-221-1/+1
|
* Introduce asdl_int_seq, to hold cmpop_ty.Martin v. Löwis2006-04-131-4/+4
|
* Convert 0 to their respective enum types. ConvertMartin v. Löwis2006-04-111-11/+11
| | | | | void* to their respective _ty types. Fix signature of ast_for_exprlist.
* low-hanging fruit in Python/ - g++ still hates all the enum_kind declarationsAnthony Baxter2006-04-111-19/+19
| | | | in Python/Python-ast.c. Not sure what to do about those.
* Add lineno, col_offset to excephandler to enable future fix forJeremy Hylton2006-04-041-28/+48
| | | | | | | | | | | | | | | 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 SF bug #1458903 with AST compiler.Neal Norwitz2006-03-271-4/+11
| | | | | | | | | | | | def foo((x)): was getting recognized as requiring tuple unpacking which is not correct. Add tests for this case and the proper way to unpack a tuple of one: def foo((x,)): test_inpsect was incorrect before. I'm not sure why it was passing, but that has been corrected with a test for both functions above. This means the test (and therefore inspect.getargspec()) are broken in 2.4.
* Forward port MvL's fix in 43227:Neal Norwitz2006-03-231-0/+4
| | | | | Fix crash when a Unicode string containing an encoding declaration is compile()d. Fixes #1115379.
* Fix bug 1441408 where a double colon didn't trigger extended slice semantics ↵Nick Coghlan2006-03-171-8/+12
| | | | (applies patch 1452332)
* SF #1444030: Fix several potential defects found by Coverity.Hye-Shik Chang2006-03-071-0/+2
| | | | (reviewed by Neal Norwitz)
* Patch #1440601: Add col_offset attribute to AST nodes.Martin v. Löwis2006-03-011-81/+91
|
* Fix uninitialized value. (Why are we using bools instead of ints, like we doThomas Wouters2006-03-011-1/+1
| | | | everywhere else?)
* Make 'as' an actual keyword when with's future statement is used. NotThomas Wouters2006-02-281-2/+2
| | | | actually necessary for functionality, but good for transition.
* Remove asdl_seq_APPEND() and simplify asdl seq implementation.Jeremy Hylton2006-02-281-62/+56
| | | | Clarify intended use of set_context() and check errors at all call sites.
* SF patch #1438387, PEP 328: relative and absolute imports.Thomas Wouters2006-02-281-12/+33
| | | | | | | | | | | | | | | | | | | | | | | - 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.
* PEP 343 -- the with-statement.Guido van Rossum2006-02-271-2/+44
| | | | | | | | | | | | | 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).
* Fix parsing of subscriptlist.Jeremy Hylton2006-02-271-4/+30
| | | | | | | (Armin's SF bug report). d = {} d[1,] = 1 Now handled correctly