summaryrefslogtreecommitdiffstats
path: root/Parser
Commit message (Collapse)AuthorAgeFilesLines
* XXXROUNDUP(): Turns out this fixed Andrew MacIntyre's memory-mgmtTim Peters2002-07-151-10/+33
| | | | | | | | | | disaster too, so this change is here to stay. Beefed up the comments and added some stats Andrew reported. Also a small change to the macro body, to make it obvious how XXXROUNDUP(0) ends up returning 0. See SF patch 578297 for context. Not a bugfix candidate, as the functional changes here have already been backported to the 2.2 line (this patch just improves clarity).
* Fix bug 439992 - [win32] KeyboardInterrupt Not Caught.Mark Hammond2002-07-141-0/+33
| | | | This gets us closer to consistent Ctrl+C behaviour on NT and Win9x. NT now reliably generates KeyboardInterrupt exceptions for NT when a file IO operation was aborted. Bugfix candidate
* I trust the parser accelators are getting added :-).Jeremy Hylton2002-07-111-6/+0
|
* Fix SF Bug 564931: compile() traceback must include filename.Thomas Heller2002-07-091-2/+11
|
* The Py_REF_DEBUG/COUNT_ALLOCS/Py_TRACE_REFS macro minefield: addedTim Peters2002-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | more trivial lexical helper macros so that uses of these guys expand to nothing at all when they're not enabled. This should help sub- standard compilers that can't do a good job of optimizing away the previous "(void)0" expressions. Py_DECREF: There's only one definition of this now. Yay! That was that last one in the family defined multiple times in an #ifdef maze. Py_FatalError(): Changed the char* signature to const char*. _Py_NegativeRefcount(): New helper function for the Py_REF_DEBUG expansion of Py_DECREF. Calling an external function cuts down on the volume of generated code. The previous inline expansion of abort() didn't work as intended on Windows (the program often kept going, and the error msg scrolled off the screen unseen). _Py_NegativeRefcount calls Py_FatalError instead, which captures our best knowledge of how to abort effectively across platforms.
* PyNode_AddChild() and fancy_roundup(): Be paranoid about int overflow.Tim Peters2002-07-081-2/+7
|
* PyNode_AddChild(): Do aggressive over-allocation when the number ofTim Peters2002-07-081-8/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | children gets large, to avoid severe platform realloc() degeneration in extreme cases (like test_longexp). Bugfix candidate. This was doing extremely timid over-allocation, just rounding up to the nearest multiple of 3. Now so long as the number of children is <= 128, it rounds up to a multiple of 4 but via a much faster method. When the number of children exceeds 128, though, and more space is needed, it doubles the capacity. This is aggressive over-allocation. SF patch <http://www.python.org/sf/578297> has Andrew MacIntyre using PyMalloc in the parser to overcome platform malloc problems in test_longexp on OS/2 EMX. Jack Jansen notes there that it didn't help him on the Mac, because the Mac has problems with frequent ever-growing reallocs, not just with gazillions of teensy mallocs. Win98 has no visible problems with test_longexp, but I tried boosting the test-case size and soon got "senseless" MemoryErrors out of it, and soon after crashed the OS: as I've seen in many other contexts before, while the Win98 realloc remains zippy in bad cases, it leads to extreme fragmentation of user address space, to the point that the OS barfs. I don't yet know whether this fixes Jack's Mac problems, but it does cure Win98's problems when boosting the test case size. It also speeds test_longexp in its unaltered state.
* Add definition of Py_IgnoreEnvironmentFlag (needed at least in debugGuido van Rossum2002-05-311-0/+1
| | | | mode).
* Py_IgnoreEnvironmentFlag should be extern, since it is declared in pythonrun.cNeal Norwitz2002-05-311-1/+1
|
* Link with the right C library! This has always been wrong (& my fault).Tim Peters2002-05-231-1/+1
|
* Py_GETENV is used by obmalloc and needs Py_IgnoreEnvironmentFlag. Provide it.Neil Schemenauer2002-04-221-0/+1
|
* Update the Windows makefile for 2.3.Tim Peters2002-04-221-3/+3
|
* Mass checkin of universal newline support.Jack Jansen2002-04-142-4/+16
| | | | | | | | Highlights: import and friends will understand any of \r, \n and \r\n as end of line. Python file input will do the same if you use mode 'U'. Everything can be disabled by configuring with --without-universal-newlines. See PEP278 for details.
* Disable the parser hacks that enabled the "yield" keyword using a futureNeil Schemenauer2002-03-222-0/+8
| | | | statement.
* Disable the parser hacks that allowed the "yield" keyword to be enabledNeil Schemenauer2002-03-221-0/+10
| | | | by a future statement.
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-121-3/+0
|
* Initialize err_ret with filename if available. Fixes #498828.Martin v. Löwis2002-01-051-5/+5
|
* PyGrammar_LabelRepr(): sprintf -> PyOS_snprintf.Tim Peters2001-12-041-2/+2
|
* The parser doesn't need its own implementation of assert, and having itsTim Peters2001-12-045-23/+4
| | | | own interfered with including Python.h. Remove Python's assert.h.
* Reverting last change so we don't have to think about the assert macroBarry Warsaw2001-11-281-5/+4
| | | | redefinition problem.
* PyGrammar_LabelRepr(): Conversion of sprintf() to PyOS_snprintf() forBarry Warsaw2001-11-281-4/+5
| | | | buffer overrun avoidance.
* 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.
* An MSVC makefile to rebuild the grammar files (graminit.[ch]) manually.Tim Peters2001-10-131-0/+42
| | | | Ugly, but it works.
* Silence parser generator output.Guido van Rossum2001-09-113-7/+11
|
* SF patch #455966: Allow leading 0 in float/imag literals.Tim Peters2001-08-301-3/+22
| | | | Consequences for Jython still unknown (but raised on Jython-Dev).
* SF bug [#455775] float parsing discrepancy.Tim Peters2001-08-271-5/+8
| | | | PyTokenizer_Get: error if exponent contains no digits (3e, 2.0e+, ...).
* Implement PEP 238 in its (almost) full glory.Guido van Rossum2001-08-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fis SF bug #442647: not all forms of legal future statements wereGuido van Rossum2001-07-191-3/+9
| | | | parsed correctly. Now they are.
* 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())
* Preliminary support for "from __future__ import generators" to enableGuido van Rossum2001-07-152-3/+36
| | | | | | | | the yield statement. I figure we have to have this in before I can release 2.2a1 on Wednesday. Note: test_generators is currently broken, I'm counting on Tim to fix this.
* SF but #417587: compiler warnings compiling 2.1.Tim Peters2001-04-211-3/+0
| | | | Repaired *some* of the SGI compiler warnings Sjoerd Mullender reported.
* RISCOS changes by dschwertberger.Guido van Rossum2001-03-022-0/+17
|
* Take output filenames as arguments instead of hard-coding them.Neil Schemenauer2001-02-161-9/+14
|
* Superseded by $(srcdir)/Makefile.pre.in.Neil Schemenauer2001-02-031-103/+0
|
* Fix a bug in stack overflow error handling. This fixes half of BugGuido van Rossum2000-10-021-1/+1
| | | | | | | | | | | #115555. The error from s_push() on stack overflow was -1, which was passed through unchanged by push(), but not tested for by push()'s caller -- which only expected positive error codes. Fixed by changing s_push() to return E_NOMEM on stack overflow. (Not quite the proper error code either, but I can't be bothered adding a new E_STACKOVERFLOW error code in all the right places.)
* More limits.h stuff in node.c.Tim Peters2000-09-261-9/+1
| | | | Fred, check this!
* Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake2000-09-261-3/+0
| | | | | | | | Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
* Move down the INT_MAX logic, because HAVE_LIMITS_H was always undefinedVladimir Marangozov2000-09-031-6/+6
| | | | | | and this breaks the AIX build with an INT_MAX redefinition error. "config.h" is included in pgenheaders.h, so moving this down fixes the problem.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-0120-180/+0
| | | | This should match the situation in the 1.6b1 tree.
* Added a little more dependency information.Fred Drake2000-08-311-1/+1
|
* Charles Waldman's patch to reinitialize the interpreter lock after aGuido van Rossum2000-08-271-0/+3
| | | | | | | fork. This solves the test_fork1 problem. (ceval.c, signalmodule.c, intrcheck.c) SourceForge: [ Patch #101226 ] make threading fork-safe
* Support for three-token characters (**=, >>=, <<=) which was written byThomas Wouters2000-08-242-0/+106
| | | | | Michael Hudson, and support in general for the augmented assignment syntax. The graminit.c patch is large!
* Charles G. Waldman <cgw@fnal.gov>:Fred Drake2000-08-241-1/+6
| | | | | | | | | Add the EXTENDED_ARG opcode to the virtual machine, allowing 32-bit arguments to opcodes instead of being forced to stick to the 16-bit limit. This is especially useful for machine-generated code, which can be too long for the SET_LINENO parameter to fit into 16 bits. This closes the implementation portion of SourceForge patch #100893.
* Simplified inclusions and avoid prototypes copied in from elsewhere.Fred Drake2000-08-231-12/+1
| | | | This also avoids a warning in anal mode.
* 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.
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-311-1/+0
| | | | marked my*.h as obsolete
* Use 'void' directly instead of the ANY #define, now that all code is ANSI C.Thomas Wouters2000-07-251-2/+1
| | | | Leave the actual #define in for API compatibility.
* Removed all instances of RETSIGTYPE from the source code: signalTim Peters2000-07-231-3/+2
| | | | | | | handlers "return void", according to ANSI C. Removed the new Py_RETURN_FROM_SIGNAL_HANDLER macro. Left RETSIGTYPE in the config stuff, because it's not clear to me that others aren't relying on it (e.g., extension modules).
* Recent ANSIfication introduced a couple instances ofTim Peters2000-07-231-3/+1
| | | | | | | | | | | #if RETSIGTYPE != void That isn't C, and MSVC properly refuses to compile it. Introduced new Py_RETURN_FROM_SIGNAL_HANDLER macro in pyport.h to expand to the correct thing based on RETSIGTYPE. However, only void is ANSI! Do we still have platforms that return int? The Unix config mess appears to #define RETSIGTYPE by magic without being asked to, so I assume it's "a problem" across Unices still.