summaryrefslogtreecommitdiff
path: root/Parser/parsetok.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused variables in parsetok().Georg Brandl2012-08-111-2/+1
|
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-181/+181
|
* fix several compile() issues by translating newlines in the tokenizerBenjamin Peterson2009-11-121-1/+1
|
* http://bugs.python.org/issue6836Kristján Valur Jónsson2009-09-281-3/+11
| | | | A memory block allocated with one API was being handed over to an object that used another API to release it.
* Surround p_flags access with #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORDChristian Heimes2008-03-261-0/+2
|
* Patch #2477: Added from __future__ import unicode_literalsChristian Heimes2008-03-261-5/+28
| | | | The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
* Backport of the print function, using a __future__ import.Eric Smith2008-03-181-22/+2
| | | | | | | | This work is substantially Anthony Baxter's, from issue 1633807. I just freshened it, made a few minor tweaks, and added the test cases. I also created issue 2412, which is to check for 2to3's behavior with the print function. I also added myself to ACKS.
* Patch #1031213: Decode source line in SyntaxErrors back to its originalMartin v. Löwis2007-09-041-5/+13
| | | | source encoding. Will backport to 2.5.
* with and as are now keywords. There are some generated files I can't recreate.Neal Norwitz2006-09-061-3/+5
|
* Handle NULL nodes while parsing. I'm not entirely sure this is correct.Neal Norwitz2006-08-121-0/+6
| | | | | | There might be something else that needs to be done to setup the error. Klocwork #295.
* Patch #1475845: Raise IndentationError for unexpected indent.Martin v. Löwis2006-05-041-1/+3
|
* Patch #1440601: Add col_offset attribute to AST nodes.Martin v. Löwis2006-03-011-2/+7
|
* 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.
* from __future__ import with_statement addon for 'with', mostly written byThomas Wouters2006-02-281-16/+39
| | | | Neal.
* Remove C99ism.Martin v. Löwis2006-02-151-1/+2
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-1/+2
|
* Prevent unlikely memory leak, tok should always be freed when parsetok() returnsNeal Norwitz2005-11-151-0/+1
|
* Merge ast-branch to headJeremy Hylton2005-10-201-3/+2
| | | | | | | | | | 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.
* - Fix segfault with invalid coding.Neal Norwitz2005-10-021-1/+1
| | | | | | | - SF Bug #772896, unknown encoding results in MemoryError, which is not helpful I will only backport the segfault fix. I'll let Anthony decide if he wants the other changes backported. I will do the backport if asked.
* Pass the flags along, rather than ignoring them. Backport candidateNeal Norwitz2004-07-081-1/+1
|
* - Finally fixed the bug in compile() and exec where a string endingGuido van Rossum2003-02-131-0/+9
| | | | | | | | | with an indented code block but no newline would raise SyntaxError. This would have been a four-line change in parsetok.c... Except codeop.py depends on this behavior, so a compilation flag had to be invented that causes the tokenizer to revert to the old behavior; this required extra changes to 2 .h files, 2 .c files, and 2 .py files. (Fixes SF bug #501622.)
* Constify filenames and scripts. Fixes #651362.Martin v. Löwis2002-12-111-7/+7
|
* Patch #534304: Implement phase 1 of PEP 263.Martin v. Löwis2002-08-041-2/+10
|
* SF patch #578297:Andrew MacIntyre2002-08-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the parser and compiler to use PyMalloc. Only the files implementing processes that will request memory allocations small enough for PyMalloc to be a win have been changed, which are:- - Python/compile.c - Parser/acceler.c - Parser/node.c - Parser/parsetok.c This augments the aggressive overallocation strategy implemented by Tim Peters in PyNode_AddChild() [Parser/node.c], in reducing the impact of platform malloc()/realloc()/free() corner case behaviour. Such corner cases are known to be triggered by test_longexp and test_import. Jeremy Hylton, in accepting this patch, recommended this as a bugfix candidate for 2.2. While the changes to Python/compile.c and Parser/node.c backport easily (and could go in), the changes to Parser/acceler.c and Parser/parsetok.c require other not insignificant changes as a result of the differences in the memory APIs between 2.3 and 2.2, which I'm not in a position to work through at the moment. This is a pity, as the Parser/parsetok.c changes are the most important after the Parser/node.c changes, due to the size of the memory requests involved and their frequency.
* Fix SF Bug 564931: compile() traceback must include filename.Thomas Heller2002-07-091-2/+11
|
* Disable the parser hacks that enabled the "yield" keyword using a futureNeil Schemenauer2002-03-221-0/+6
| | | | statement.
* Initialize err_ret with filename if available. Fixes #498828.Martin v. Löwis2002-01-051-5/+5
|
* Patch from SF bug #472956: UMR when there is a syntax error (Neal Norwitz)Guido van Rossum2001-10-201-12/+15
| | | | | perrdetail.token is unitialized when there is a syntax error in a file.
* Add a really stupid warning about 'yield' used as an identifier.Guido van Rossum2001-07-171-0/+12
| | | | | | | | | | | | | | | This is really stupid because it cannot be suppressed or altered using the warning framework; that's because the warning framework is built on Python interpreter internals, and the parser generator doesn't have access to any of those (you cannot use anything of type PyObject * in the parser). But it's better than nothing, and implementing a proper check for this appears to require modifying compile.c in a dozen places, for which I don't have the stamina today. I promise we'll do better in 2.2a2. At least it tells you the filename and line number (unlike the first hack I considered :-).
* Ugly. A pile of new xxxFlags() functions, to communicate to the parserTim Peters2001-07-161-5/+22
| | | | | | | | | | | | | | | | | | | | | | | that 'yield' is a keyword. This doesn't help test_generators at all! I don't know why not. These things do work now (and didn't before this patch): 1. "from __future__ import generators" now works in a native shell. 2. Similarly "python -i xxx.py" now has generators enabled in the shell if xxx.py had them enabled. 3. This program (which was my doctest proxy) works fine: from __future__ import generators source = """\ def f(): yield 1 """ exec compile(source, "", "single") in globals() print type(f())
* 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.
* PyParser_ParseString(): When the err_ret structure is initialized, theBarry Warsaw2000-08-181-0/+2
| | | | | | fields token and expected must also be initialized, otherwise the tests in parsetok() can generate uninitialized memory read errors. This quiets an Insure warning.
* Mass ANSIfication.Thomas Wouters2000-07-221-17/+4
| | | | | | Work around intrcheck.c's desire to pass 'PyErr_CheckSignals' to 'Py_AddPendingCall' by providing a (static) wrapper function that has the right number of arguments.
* Create two new exceptions: IndentationError and TabError. These areFred Drake2000-07-111-2/+2
| | | | | | | used for indentation related errors. This patch includes Ping's improvements for indentation-related error messages. Closes SourceForge patches #100734 and #100856.
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-091-2/+1
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick: familiar simple Win64 patchesGuido van Rossum2000-06-281-2/+2
|
* Jack Jansen: Removed Macintosh tab-guessing codeGuido van Rossum2000-06-281-7/+0
|
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-1/+1
| | | | | | | | | | 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.)
* Make sure that -t and -tt also work on strings passed to compile().Guido van Rossum1998-12-211-0/+7
|
* Declare and use Py_TabcheckFlag here.Guido van Rossum1998-04-101-0/+8
|
* Finally plug the memory leak caused by syntax error (includingGuido van Rossum1997-07-271-1/+4
| | | | interactive EOF, which leaked *one* byte).
* Another directory quickly renamed.Guido van Rossum1997-04-291-11/+12
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* fix strncpy call (uninitialized memory read)Guido van Rossum1995-01-201-1/+2
|
* Added 1995 to copyright message.Guido van Rossum1995-01-041-2/+2
|
* don't call strncpy(str, NULL, 0)Guido van Rossum1994-08-291-81/+79
|
* * Changed many files to use mkvalue() instead of newtupleobject().Guido van Rossum1993-03-161-4/+7
| | | | | | | | | | * Fixcprt.py: added [-y file] option, do only files younger than file. * modsupport.[ch]: added vmkvalue(). * intobject.c: use mkvalue(). * stringobject.c: added "formatstring"; renamed string* to string_*; ceval.c: call formatstring for string % value. * longobject.c: close memory leak in divmod. * parsetok.c: set result node to NULL when returning an error.
* Copyright for 1992 addedGuido van Rossum1992-04-051-1/+1
|