summaryrefslogtreecommitdiffstats
path: root/Include/node.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40939: Remove the old parser (Part 2) (GH-21005)Lysandros Nikolaou2020-06-201-47/+0
| | | Remove some remaining files and Makefile targets for the old parser
* bpo-39702: Relax grammar restrictions on decorators (PEP 614) (GH-18570)Brandt Bucher2020-03-031-1/+0
|
* bpo-33416: Add end positions to Python AST (GH-11605)Ivan Levkivskyi2019-01-221-1/+5
| | | | | | | | | | | | | | | | | | The majority of this PR is tediously passing `end_lineno` and `end_col_offset` everywhere. Here are non-trivial points: * It is not possible to reconstruct end positions in AST "on the fly", some information is lost after an AST node is constructed, so we need two more attributes for every AST node `end_lineno` and `end_col_offset`. * I add end position information to both CST and AST. Although it may be technically possible to avoid adding end positions to CST, the code becomes more cumbersome and less efficient. * Since the end position is not known for non-leaf CST nodes while the next token is added, this requires a bit of extra care (see `_PyNode_FinalizeEndPos`). Unless I made some mistake, the algorithm should be linear. * For statements, I "trim" the end position of suites to not include the terminal newlines and dedent (this seems to be what people would expect), for example in ```python class C: pass pass ``` the end line and end column for the class definition is (2, 8). * For `end_col_offset` I use the common Python convention for indexing, for example for `pass` the `end_col_offset` is 4 (not 3), so that `[0:4]` gives one the source code that corresponds to the node. * I added a helper function `ast.get_source_segment()`, to get source text segment corresponding to a given AST node. It is also useful for testing. An (inevitable) downside of this PR is that AST now takes almost 25% more memory. I think however it is probably justified by the benefits.
* bpo-32150: Expand tabs to spaces in C files. (#4583)Serhiy Storchaka2017-11-281-11/+11
|
* Removed trailing tabs.Serhiy Storchaka2015-03-211-1/+1
|
* Issue #18637: Fixed an error in _PyNode_SizeOf declaration.Serhiy Storchaka2014-11-181-1/+1
| | | | Patch by Roumen Petrov.
* MERGE: Closes #15512: Correct __sizeof__ support for parserJesus Cea2012-08-031-0/+3
|\
| * Closes #15512: Correct __sizeof__ support for parserJesus Cea2012-08-031-0/+3
| |
* | move LINENO define to where it actually belongsBenjamin Peterson2012-01-161-0/+1
|/
* Patch #1440601: Add col_offset attribute to AST nodes.Martin v. Löwis2006-03-011-1/+2
|
* PEP-0318, @decorator-style. In Guido's words:Anthony Baxter2004-08-021-0/+2
| | | | | "@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
* Back out the previous change. It doesn't save any space on 64-bitGuido van Rossum2002-09-171-2/+2
| | | | platforms.
* Rearrange the members of struct _node to put shorter fields towardsGuido van Rossum2002-09-171-2/+2
| | | | | | | | | | the end, in the hope of saving some bytes on 64-bit machines. (Too bad n_nchildren can't be made an unsigned short, but test/test_longexp.py specifically tests for more than 2**16 subtrees at one level.) I don't expect any binary compatibility issues here, unless someone has an old binary of parsermodule.so saved away.
* Excise DL_EXPORT from Include.Mark Hammond2002-08-121-4/+4
| | | | Thanks to Skip Montanaro and Kalle Svensson for the patches.
* Use an assert() for the REQ() macro instead of making up our ownGuido van Rossum2001-10-151-10/+1
| | | | assertion.
* 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.
* Charles G. Waldman <cgw@fnal.gov>:Fred Drake2000-08-241-2/+2
| | | | | | | | | 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.
* ANSI-fication and Py_PROTO extermination.Fred Drake2000-07-081-18/+19
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-21/+6
|
* Add new parser error code, E_OVERFLOW. This error is returned whenJeremy Hylton2000-06-201-1/+1
| | | | | | the number of children of a node exceeds the max possible value for the short that is used to count them. The Python runtime converts this parser error into the SyntaxError "expression too long."
* Add DL_IMPORT(returntype) for all officially exported functions.Guido van Rossum1998-12-041-4/+4
|
* Rename DEBUG macro to Py_DEBUGGuido van Rossum1996-12-301-1/+1
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-12/+19
|
* The great renaming, phase two: all header files have been updated toGuido van Rossum1995-01-121-4/+4
| | | | | | | use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
* Added 1995 copyright.Guido van Rossum1995-01-041-2/+2
| | | | | | object.h: made sizes and refcnts signed ints. stringobject.h: make getstrsize() signed int. methodobject.h: add METH_VARARGS and METH_FREENAME flag bit definitions.
* Include/node.h: make some fields short to save space duringGuido van Rossum1994-08-231-3/+3
| | | | parsing
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-1/+1
|
* * ceval.c, longobject.c, methodobject.c, listnode.c, arraymodule.c,Guido van Rossum1993-11-011-1/+0
| | | | | | pythonrun.c: added static forward declarations * pythonrun.h, ceval.h, longobject.h, node.h: removed declarations of static routines
* * Added support for X11 modules.Guido van Rossum1993-07-281-0/+11
| | | | | | | * Makefile: change location of FORMS library. * posixmodule.c: turn #if 0 into #ifdef MSDOS (stuff in unistd.h or not) * Almost all .h files: added CPP magic to avoid duplicate inclusions and to support inclusion from C++.
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-2/+2
| | | | | | | | | | | | | | | | | * Stubs for faster implementation of local variables (not yet finished) * Added function name to code object. Print it for code and function objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version number has changed accordingly) * Print address of self for built-in methods * New internal functions getattro and setattro (getattr/setattr with string object arg) * Replaced "dictobject" with more powerful "mappingobject" * New per-type functio tp_hash to implement arbitrary object hashing, and hashobject() to interface to it * Added built-in functions hash(v) and hasattr(v, 'name') * classobject: made some functions static that accidentally weren't; added __hash__ special instance method to implement hash() * Added proper comparison for built-in methods and functions
* Copyright for 1992 addedGuido van Rossum1992-04-051-1/+1
|
* Added copyright notice.Guido van Rossum1991-02-191-0/+24
|
* "Compiling" versionGuido van Rossum1990-12-201-3/+7
|
* Added prototype for new function freenode().Guido van Rossum1990-11-181-0/+1
|
* Initial revisionGuido van Rossum1990-10-141-0/+29