summaryrefslogtreecommitdiffstats
path: root/Python/graminit.c
Commit message (Collapse)AuthorAgeFilesLines
* remove dictmaker rule; it's unusedBenjamin Peterson2010-12-111-215/+188
|
* Use 4-spaces for indentation (instead of tabs) in pgen outputsVictor Stinner2010-05-151-1287/+1287
| | | | Regenerate (reindent) Python/graminit.c
* Issue #2333: Backport set and dict comprehensions syntax.Alexandre Vassalotti2010-01-111-21/+36
|
* Issue #2335: Backport set literals syntax from Python 3.x.Alexandre Vassalotti2010-01-091-162/+205
|
* Allow multiple context managers in one with statement, as proposedGeorg Brandl2009-05-251-19/+20
| | | | | | | in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics.
* Issue #4279: Fix build of parsermodule under Cygwin.Martin v. Löwis2009-01-111-0/+1
|
* allow keyword args to be passed in after *args #3473Benjamin Peterson2008-08-191-2/+3
|
* #2627 Let it be known what pgen generatesBenjamin Peterson2008-04-131-0/+2
|
* Patch #1759: Backport of PEP 3129 class decoratorsChristian Heimes2008-02-231-1166/+1180
| | | | with some help from Georg
* Backport PEP 3110's new 'except' syntax to 2.6.Collin Winter2007-05-181-2/+3
|
* with and as are now keywords. There are some generated files I can't recreate.Neal Norwitz2006-09-061-10/+7
|
* Update graminit.c for the fix for #1488915, Multiple dots in relative importThomas Wouters2006-05-251-20/+15
| | | | statement raise SyntaxError, and add testcase.
* Part two of the fix for SF bug #1466641: Regenerate graminit.c and add testThomas Wouters2006-04-121-2/+2
| | | | for the bogus failure.
* Make 'as' an actual keyword when with's future statement is used. NotThomas Wouters2006-02-281-189/+193
| | | | actually necessary for functionality, but good for transition.
* SF patch #1438387, PEP 328: relative and absolute imports.Thomas Wouters2006-02-281-18/+29
| | | | | | | | | | | | | | | | | | | | | | | - 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-600/+649
| | | | | | | | | | | | | 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).
* PEP 308 implementation, including minor refdocs and some testcases. ItThomas Wouters2006-02-271-517/+579
| | | | | | | | | | | | | | | | | | | | | | | | | 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 ;)
* Oops, I forgot to check this in with the change to Grammar/Grammar.Neal Norwitz2006-02-261-16/+3
| | | | | Implement change suggested by Jiwon Seo on python-dev. ['(' gen_for ')'] is redundant with test, so remove it.
* Wrap long lines in the grammarNeal Norwitz2005-12-181-16/+17
|
* SF patch #1355913, PEP 341 - Unification of try/except and try/finallyNeal Norwitz2005-12-171-5/+19
| | | | Modified since ast-arenas was implemented.
* Fix SF bug #1167751, Argument genexp corner caseNeal Norwitz2005-10-211-7/+15
| | | | | | | | | | | | | Incorrect code was generated for: foo(a = i for i in range(10)) This should have generated a SyntaxError. Fix the Grammar so it raises a SyntaxError and test it. I'm uncertain whether this should be backported. It makes something that was Syntactically valid invalid. However, the code would either be completely broken or do the wrong thing.
* PEP 342 implementation. Per Guido's comments, the generator throw()Phillip J. Eby2005-08-021-111/+128
| | | | | method still needs to support string exceptions, and allow None for the third argument. Documentation updates are needed, too.
* Allow classes to be defined with empty parentheses. This means thatBrett Cannon2005-03-051-6/+7
| | | | ``class C(): pass`` is no longer a syntax error.
* SF patch #1007189, multi-line imports, for instance:Anthony Baxter2004-08-311-783/+837
| | | | | "from blah import (foo, bar baz, bongo)"
* This is Mark Russell's patch:Michael W. Hudson2004-08-171-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ 1009560 ] Fix @decorator evaluation order From the description: Changes in this patch: - Change Grammar/Grammar to require newlines between adjacent decorators. - Fix order of evaluation of decorators in the C (compile.c) and python (Lib/compiler/pycodegen.py) compilers - Add better order of evaluation check to test_decorators.py (test_eval_order) - Update the decorator documentation in the reference manual (improve description of evaluation order and update syntax description) and the comment: Used Brett's evaluation order (see http://mail.python.org/pipermail/python-dev/2004-August/047835.html) (I'm checking this in for Anthony who was having problems getting SF to talk to him)
* PEP-0318, @decorator-style. In Guido's words:Anthony Baxter2004-08-021-1084/+1140
| | | | | "@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
* SF patch #872326: Generator expression implementationRaymond Hettinger2004-05-191-301/+402
| | | | | | | | | | | | | | (Code contributed by Jiwon Seo.) The documentation portion of the patch is being re-worked and will be checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's rationale for the design decisions on binding behavior (as described in in his patch comments and in discussions on python-dev). The test file, test_genexps.py, is written in doctest format and is meant to exercise all aspects of the the patch. Further additions are welcome from everyone. Please stress test this new feature as much as possible before the alpha release.
* Patch #534304: Implement phase 1 of PEP 263.Martin v. Löwis2002-08-041-4/+17
|
* Disambiguate the grammar for backtick.Guido van Rossum2002-05-241-57/+71
| | | | | | The old syntax suggested that a trailing comma was OK inside backticks, but in fact (due to ideosyncrasies of pgen) it was not. Fix the grammar to avoid the ambiguity. Fred: you may want to update the refman.
* John Aycock correctly pointed out that the grammar forTim Peters2002-05-231-3/+2
| | | | "power" was formally ambiguous. Here's his fix.
* Very subtle syntax change: in a list comprehension, the testlist inGuido van Rossum2001-10-151-102/+130
| | | | | | | | | | | | | | | "for <var> in <testlist> may no longer be a single test followed by a comma. This solves SF bug #431886. Note that if the testlist contains more than one test, a trailing comma is still allowed, for maximum backward compatibility; but this example is not: [(x, y) for x in range(10), for y in range(10)] ^ The fix involved creating a new nonterminal 'testlist_safe' whose definition doesn't allow the trailing comma if there's only one test: testlist_safe: test [(',' test)+ [',']]
* Implement PEP 238 in its (almost) full glory.Guido van Rossum2001-08-081-192/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | This introduces: - A new operator // that means floor division (the kind of division where 1/2 is 0). - The "future division" statement ("from __future__ import division) which changes the meaning of the / operator to implement "true division" (where 1/2 is 0.5). - New overloadable operators __truediv__ and __floordiv__. - New slots in the PyNumberMethods struct for true and floor division, new abstract APIs for them, new opcodes, and so on. I emphasize that without the future division statement, the semantics of / will remain unchanged until Python 3.0. Not yet implemented are warnings (default off) when / is used with int or long arguments. This has been on display since 7/31 as SF patch #443474. Flames to /dev/null.
* Merging the gen-branch into the main line, at Guido's direction. Yay!Tim Peters2001-06-181-658/+677
| | | | | Bugfix candidate in inspect.py: it was referencing "self" outside of a method.
* Support for three-token characters (**=, >>=, <<=) which was written byThomas Wouters2000-08-241-753/+805
| | | | | Michael Hudson, and support in general for the augmented assignment syntax. The graminit.c patch is large!
* require list comprehensions to start with a for clauseSkip Montanaro2000-08-221-5/+5
|
* PEP 214, Extended print Statement, has been accepted by the BDFL.Barry Warsaw2000-08-211-122/+151
| | | | | | | eval_code2(): Implement new bytecodes PRINT_ITEM_TO and PRINT_NEWLINE_TO, as per accepted SF patch #100970. Also update graminit.c based on related Grammar/Grammar changes.
* Apply SF patch #101135, adding 'import module as m' and 'from module importThomas Wouters2000-08-171-640/+684
| | | | | | | | name as n'. By doing some twists and turns, "as" is not a reserved word. There is a slight change in semantics for 'from module import name' (it will now honour the 'global' keyword) but only in cases that are explicitly undocumented.
* list comprehensions. seeSkip Montanaro2000-08-121-201/+296
| | | | | | http://sourceforge.net/patch/?func=detailpatch&patch_id=100654&group_id=5470 for details.
* slightly modified version of Greg Ewing's extended call syntax patchJeremy Hylton2000-03-281-21/+40
| | | | | | | | | | | | | | | | | | | | | | | executive summary: Instead of typing 'apply(f, args, kwargs)' you can type 'f(*arg, **kwargs)'. Some file-by-file details follow. Grammar/Grammar: simplify varargslist, replacing '*' '*' with '**' add * & ** options to arglist Include/opcode.h & Lib/dis.py: define three new opcodes CALL_FUNCTION_VAR CALL_FUNCTION_KW CALL_FUNCTION_VAR_KW Python/ceval.c: extend TypeError "keyword parameter redefined" message to include the name of the offending keyword reindent CALL_FUNCTION using four spaces add handling of sequences and dictionaries using extend calls fix function import_from to use PyErr_Format
* Make first raise argument optionalGuido van Rossum1998-04-091-2/+3
|
* Oops, missed some renamings.Guido van Rossum1997-05-071-1/+1
|
* OK, ready to make 'assert' a keyword (instead of '__assert__').Guido van Rossum1997-04-161-1/+1
|
* Added assert grammar.Guido van Rossum1997-04-021-494/+522
|
* Disable support for access statementGuido van Rossum1996-08-121-587/+535
|
* Changes for slice and ellipsesGuido van Rossum1996-07-301-103/+144
|
* changes for power (**) operatorGuido van Rossum1996-01-121-325/+359
|
* new grammarGuido van Rossum1995-07-071-74/+142
|
* Grammar changedGuido van Rossum1995-01-071-466/+480
|
* Merge back to main trunkGuido van Rossum1994-08-301-78/+94
|
* change syntactical position of lambdef (was an atom, now is a test)Guido van Rossum1993-11-301-73/+81
|