summaryrefslogtreecommitdiffstats
path: root/Modules/parsermodule.c
Commit message (Collapse)AuthorAgeFilesLines
* SF patch #872326: Generator expression implementationRaymond Hettinger2004-05-191-6/+115
| | | | | | | | | | | | | | (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.
* Getting rid of all the code inside #ifdef macintosh too.Jack Jansen2003-11-201-4/+0
|
* Merge 23c1-branch back into the head. Barry will send email about theTim Peters2003-07-211-4/+12
| | | | | | New Plan (releases to be made off the head, ongoing random 2.4 stuff to be done on a short-lived branch, provided anyone is motivated enough to create one).
* Don't use (PyObject *)PyObject_Type(x). It is a leaky and verbose wayGuido van Rossum2003-04-091-2/+2
| | | | of saying x->ob_type.
* Remove duplicate code introduced by fixing bug #678518Neal Norwitz2003-02-101-3/+0
|
* Remove unused variable.Guido van Rossum2003-02-091-1/+0
|
* Apply logistix's patch fromMichael W. Hudson2003-02-081-3/+43
| | | | [ 678518 ] Another parsermodule validation error
* Teach the parsermodule about floor division. FixesMichael W. Hudson2003-01-291-0/+2
| | | | | | [ 676521 ] parser module validation failure bugfix candidate.
* SF patch [ 597919 ] compiler package and SET_LINENOJeremy Hylton2002-12-311-6/+7
| | | | | | | | | | | | | | | | | A variety of changes from Michael Hudson to get the compiler working with 2.3. The primary change is the handling of SET_LINENO: # The set_lineno() function and the explicit emit() calls for # SET_LINENO below are only used to generate the line number table. # As of Python 2.3, the interpreter does not have a SET_LINENO # instruction. pyassem treats SET_LINENO opcodes as a special case. A few other small changes: - Remove unused code from pycodegen and pyassem. - Fix error handling in parsermodule. When PyParser_SimplerParseString() fails, it sets an exception with detailed info. The parsermodule was clobbering that exception and replacing it was a generic "could not parse string" exception. Keep the original exception.
* Allow more docstrings to be removed during compilation in some modulesNeal Norwitz2002-08-131-20/+20
|
* Replace DL_IMPORT with PyMODINIT_FUNC and remove "/export:init..." linkMark Hammond2002-07-231-2/+2
| | | | | command line for Windows builds. This should allow MSVC to import and build the Python MSVC6 project files without error.
* staticforward bites the dust.Jeremy Hylton2002-07-171-12/+7
| | | | | | | | | | | | | | | The staticforward define was needed to support certain broken C compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the static keyword when it was used with a forward declaration of a static initialized structure. Standard C allows the forward declaration with static, and we've decided to stop catering to broken C compilers. (In fact, we expect that the compilers are all fixed eight years later.) I'm leaving staticforward and statichere defined in object.h as static. This is only for backwards compatibility with C extensions that might still use it. XXX I haven't updated the documentation.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-8/+5
|
* Disambiguate the grammar for backtick.Guido van Rossum2002-05-241-1/+13
| | | | | | 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.
* Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum2001-12-081-1/+1
| | | | | | | | | | | | | type.__module__ behavior. This adds the module name and a dot in front of the type name in every type object initializer, except for built-in types (and those that already had this). Note that it touches lots of Mac modules -- I have no way to test these but the changes look right. Apologies if they're not. This also touches the weakref docs, which contains a sample type object initializer. It also touches the mmap test output, because the mmap type's repr is included in that output. It touches object.h to put the correct description in a comment.
* Fix memory leak in the parser module: There were two leaks inFred Drake2001-12-051-5/+22
| | | | | | parser_tuple2st() and a failure to propogate an error in build_node_children() (masking yet another leak, of course!). This closes SF bug #485133 (confirmed by Insure++).
* Very subtle syntax change: in a list comprehension, the testlist inGuido van Rossum2001-10-151-1/+9
| | | | | | | | | | | | | | | "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)+ [',']]
* Use the abstract object interfaces when digging around in module objectsFred Drake2001-08-151-19/+19
| | | | instead of directly manipulating the underlying dictionary.
* Elaborate a comment.Fred Drake2001-07-191-1/+4
|
* The syntax trees handled by this module are not "abstract," so take theFred Drake2001-07-171-132/+136
| | | | | "A" out of the internal abbreviations. For published functions with "ast" in their names, make alternate offerings using just "st".
* Add support for yield statements.Fred Drake2001-07-171-1/+17
| | | | (Should be merged with descr branch.)
* Properly use &&. Closes bug #434989.Martin v. Löwis2001-06-231-1/+1
|
* Fix problems with validation of import statement parse trees.Fred Drake2001-01-071-5/+24
| | | | This closes SF bug #127271.
* validate_varargslist(): Fix two bugs in this function, one that affectedFred Drake2000-12-111-11/+20
| | | | | | | it when *args and/or **kw are used, and one when they are not. This closes bug #125375: "parser.tuple2ast() failure on valid parse tree".
* Ka-Ping Yee <ping@lfw.org>:Fred Drake2000-10-241-21/+21
| | | | | | Changes to error messages to increase consistency & clarity. This (mostly) closes SourceForge patch #101839.
* Simplify some of the code. Use PyErr_Format() instead of sprintf(), etc.Fred Drake2000-09-121-186/+122
| | | | Reduces lines of code and compiled object size.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Do the absolute minimal amount of modifications to eradicateBarry Warsaw2000-09-011-5/+4
| | | | | | | | | | | | | | | Py_FatalError() from module initialization functions. The importing mechanism already checks for PyErr_Occurred() after module importation and it Does The Right Thing. Unfortunately, the following either were not compiled or tested by the regression suite, due to issues with my development platform: almodule.c cdmodule.c mpzmodule.c puremodule.c timingmodule.c
* Try to supply a prototype for the module init function but avoidTim Peters2000-08-261-1/+1
| | | | | | Windows "inconsistent linkage" warnings at the same time. I agree with Mark Hammond that the whole DL_IMPORT/DL_EXPORT macro system needs an overhaul; this is just an expedient hack until then.
* Update the parser module to support augmented assignment.Fred Drake2000-08-251-6/+30
| | | | Add some test cases.
* validate_listmaker(): Revise to match Skip's latest changes to theFred Drake2000-08-231-6/+12
| | | | Grammar file. This makes the test suite pass once again.
* Nuked unused variable.Tim Peters2000-08-221-1/+0
|
* Update to reflect recent grammar changes (list comprehensions, extendedFred Drake2000-08-211-178/+363
| | | | | | print statement), and fix up the extended call syntax support. Minor stylistic cleanups.
* ANSIfy a bit more.Thomas Wouters2000-07-241-1/+1
|
* Even more ANSIfication: fix as many function pointers and declarations asThomas Wouters2000-07-221-1/+1
| | | | possible.
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-3/+3
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton2000-07-121-5/+5
|
* ANSI-fyingPeter Schneider-Kamp2000-07-101-12/+4
| | | | | added excplicit node * parameter to termvalid argument in validate_two_chain_ops of parsermodule.c (as proposed by fred)
* Remove use of HAVE_OLD_CPP to support non-ANSI preprocessors.Fred Drake2000-07-091-4/+0
|
* Remove warning about local variable possibly being using uninitialized;Fred Drake2000-07-041-1/+1
| | | | noted by Marc-Andre Lemburg <mal@lemburg.com>.
* Andrew Kuchling <akuchlin@mems-exchange.org>:Fred Drake2000-07-031-1/+1
| | | | Typo in string literal: execpt --> except
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-4/+4
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
* validate_arglist(): Re-written to reflect extended call syntax.Fred Drake2000-04-251-3/+80
| | | | | validate_numnodes(): Added comment to explain the sometimes idiomatic usage pattern.
* ANSI-fy & de-tabify the source.Fred Drake2000-04-191-1505/+1317
| | | | (4-space indents already used.)
* What used to be tp_xxx4 is now tp_flags; set it to Py_TPFLAGS_DEFAULT.Fred Drake2000-02-211-2/+1
|
* parser__pickler(): Don't drop the third argument toFred Drake1999-09-201-5/+11
| | | | | | | parser_ast2tuple(). Create an temporary empty dictionary to use. Bug reported by Mark Favas <m.favas@per.dem.csiro.au>. Fix a couple of comments.
* Added keyword parameter support to all public interfaces; keywordFred Drake1999-09-091-62/+76
| | | | | | | | | names match the documentation. Removed broken code that supports the __methods__ attribute on ast objects; the right magic was added to Py_FindMethod() since this was originally written. <ast-object>.__methods__ now works, so dir() and rlcompleter are happy.
* When the parameter to PyInt_AsLong() has already been checked withFred Drake1999-02-171-2/+2
| | | | PyInt_Check(), use PyInt_AS_LONG() instead (two places).