summaryrefslogtreecommitdiff
path: root/Python/graminit.c
AgeCommit message (Collapse)AuthorLines
2010-05-15Merged revisions 81220 via svnmerge fromVictor Stinner-1252/+1252
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81220 | victor.stinner | 2010-05-16 00:55:28 +0200 (dim., 16 mai 2010) | 4 lines Use 4-spaces for indentation (instead of tabs) in pgen outputs Regenerate (reindent) Python/graminit.c ........
2009-01-11Merged revisions 68523 via svnmerge fromMartin v. Löwis-0/+1
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68523 | martin.v.loewis | 2009-01-11 10:26:54 +0100 (So, 11 Jan 2009) | 2 lines Issue #4279: Fix build of parsermodule under Cygwin. ........
2008-08-19allow keyword args to be passed in after *args #3473Benjamin Peterson-2/+3
2008-04-13#2627 Let it be known what pgen generatesBenjamin Peterson-0/+2
2008-02-23Patch #1759: Backport of PEP 3129 class decoratorsChristian Heimes-1164/+1178
with some help from Georg
2007-05-18Backport PEP 3110's new 'except' syntax to 2.6.Collin Winter-2/+3
2006-09-06with and as are now keywords. There are some generated files I can't recreate.Neal Norwitz-10/+7
2006-05-25Update graminit.c for the fix for #1488915, Multiple dots in relative importThomas Wouters-20/+15
statement raise SyntaxError, and add testcase.
2006-04-12Part two of the fix for SF bug #1466641: Regenerate graminit.c and add testThomas Wouters-2/+2
for the bogus failure.
2006-02-28Make 'as' an actual keyword when with's future statement is used. NotThomas Wouters-189/+193
actually necessary for functionality, but good for transition.
2006-02-28SF patch #1438387, PEP 328: relative and absolute imports.Thomas Wouters-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.
2006-02-27PEP 343 -- the with-statement.Guido van Rossum-598/+647
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).
2006-02-27PEP 308 implementation, including minor refdocs and some testcases. ItThomas Wouters-516/+578
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 ;)
2006-02-26Oops, I forgot to check this in with the change to Grammar/Grammar.Neal Norwitz-16/+3
Implement change suggested by Jiwon Seo on python-dev. ['(' gen_for ')'] is redundant with test, so remove it.
2005-12-18Wrap long lines in the grammarNeal Norwitz-16/+17
2005-12-17SF patch #1355913, PEP 341 - Unification of try/except and try/finallyNeal Norwitz-5/+19
Modified since ast-arenas was implemented.
2005-10-21Fix SF bug #1167751, Argument genexp corner caseNeal Norwitz-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.
2005-08-02PEP 342 implementation. Per Guido's comments, the generator throw()Phillip J. Eby-111/+128
method still needs to support string exceptions, and allow None for the third argument. Documentation updates are needed, too.
2005-03-05Allow classes to be defined with empty parentheses. This means thatBrett Cannon-6/+7
``class C(): pass`` is no longer a syntax error.
2004-08-31SF patch #1007189, multi-line imports, for instance:Anthony Baxter-781/+835
"from blah import (foo, bar baz, bongo)"
2004-08-17This is Mark Russell's patch:Michael W. Hudson-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)
2004-08-02PEP-0318, @decorator-style. In Guido's words:Anthony Baxter-1079/+1135
"@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
2004-05-19SF patch #872326: Generator expression implementationRaymond Hettinger-299/+400
(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.
2002-08-04Patch #534304: Implement phase 1 of PEP 263.Martin v. Löwis-4/+17
2002-05-24Disambiguate the grammar for backtick.Guido van Rossum-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.
2002-05-23John Aycock correctly pointed out that the grammar forTim Peters-3/+2
"power" was formally ambiguous. Here's his fix.
2001-10-15Very subtle syntax change: in a list comprehension, the testlist inGuido van Rossum-101/+129
"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)+ [',']]
2001-08-08Implement PEP 238 in its (almost) full glory.Guido van Rossum-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.
2001-06-18Merging the gen-branch into the main line, at Guido's direction. Yay!Tim Peters-654/+673
Bugfix candidate in inspect.py: it was referencing "self" outside of a method.
2000-08-24Support for three-token characters (**=, >>=, <<=) which was written byThomas Wouters-749/+801
Michael Hudson, and support in general for the augmented assignment syntax. The graminit.c patch is large!
2000-08-22require list comprehensions to start with a for clauseSkip Montanaro-5/+5
2000-08-21PEP 214, Extended print Statement, has been accepted by the BDFL.Barry Warsaw-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.
2000-08-17Apply SF patch #101135, adding 'import module as m' and 'from module importThomas Wouters-636/+680
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.
2000-08-12list comprehensions. seeSkip Montanaro-199/+294
http://sourceforge.net/patch/?func=detailpatch&patch_id=100654&group_id=5470 for details.
2000-03-28slightly modified version of Greg Ewing's extended call syntax patchJeremy Hylton-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
1998-04-09Make first raise argument optionalGuido van Rossum-2/+3
1997-05-07Oops, missed some renamings.Guido van Rossum-1/+1
1997-04-16OK, ready to make 'assert' a keyword (instead of '__assert__').Guido van Rossum-1/+1
1997-04-02Added assert grammar.Guido van Rossum-493/+521
1996-08-12Disable support for access statementGuido van Rossum-584/+532
1996-07-30Changes for slice and ellipsesGuido van Rossum-103/+144
1996-01-12changes for power (**) operatorGuido van Rossum-324/+358
1995-07-07new grammarGuido van Rossum-74/+142
1995-01-07Grammar changedGuido van Rossum-462/+476
1994-08-30Merge back to main trunkGuido van Rossum-78/+94
1993-11-30change syntactical position of lambdef (was an atom, now is a test)Guido van Rossum-73/+81
1993-11-30* import.c (get_module): pass .py filename to parse_file, not .pyc filename!Guido van Rossum-624/+626
* funcobject.c (func_repr): don't call getstringvalue(None) for anonymous functions. * bltinmodule.c: removed lambda (which is now a built-in function); removed implied lambda for string arg to filter/map/reduce. * Grammar, graminit.[ch], compile.[ch]: replaced lambda as built-in function by lambda as grammar entity: instead of "lambda('x: x+1')" you write "lambda x: x+1". * Xtmodule.c (checkargdict): return 0, not NULL, for error.
1993-10-27Committing the correct graminit.c; also changed confusing comments in Grammar.Guido van Rossum-714/+697
1993-10-26* compile.[ch]: support for lambda()Guido van Rossum-675/+701
* PROTO.h, mymalloc.h: added #ifdefs for TURBOC and GNUC. * allobjects.h: added #include "rangeobject.h" * Grammar: added lambda_input; relaxed syntax for exec. * bltinmodule.c: added bagof, map, reduce, lambda, xrange. * tupleobject.[ch]: added resizetuple(). * rangeobject.[ch]: new object type to speed up range operations (not convinced this is needed!!!)
1993-10-18* bltinmodule.c: removed exec() built-in function.Guido van Rossum-395/+432
* Grammar: add exec statement; allow testlist in expr statement. * ceval.c, compile.c, opcode.h: support exec statement; avoid optimizing locals when it is used * fileobject.{c,h}: add getfilename() internal function.