| Commit message (Collapse) | Author | Age | Files | Lines | |
|---|---|---|---|---|---|
| * | bpo-35766: Merge typed_ast back into CPython (GH-11645) | Guido van Rossum | 2019-01-31 | 1 | -0/+6 |
| | | |||||
| * | bpo-33416: Add end positions to Python AST (GH-11605) | Ivan Levkivskyi | 2019-01-22 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | 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-33012: Fix invalid function cast warnings with gcc 8. (GH-6749) | Serhiy Storchaka | 2018-11-27 | 1 | -14/+14 |
| | | | | | | | Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code. | ||||
| * | bpo-35177, Python-ast.h: Fix "Yield" compiler warning (GH-10664) | Victor Stinner | 2018-11-22 | 1 | -0/+1 |
| | | | | | | | | | Partially revert commit 5f2df88b63e50d23914e97ec778861a52abdeaad: add "#undef Yield" to .c files after including Python-ast.h. Fix the warning: winbase.h(102): warning C4005: 'Yield': macro redefinition | ||||
| * | bpo-35177: Add dependencies between header files (GH-10361) | Victor Stinner | 2018-11-11 | 1 | -3/+2 |
| | | | | | | | | | | | | | | | * ast.h now includes Python-ast.h and node.h * parsetok.h now includes node.h and grammar.h * symtable.h now includes Python-ast.h * Modify asdl_c.py to enhance Python-ast.h: * Add #ifndef/#define Py_PYTHON_AST_H to be able to include the header twice * Add "extern { ... }" for C++ * Undefine "Yield" macro conflicting with winbase.h * Remove "#undef Yield" from C files, it's now done in Python-ast.h * Remove now useless includes in C files | ||||
| * | bpo-33308: Fix a crash in the parser module when convert an ST object. (#6519) | Serhiy Storchaka | 2018-04-18 | 1 | -3/+3 |
| | | | | | Converting with line_info=False and col_info=True crashed before. | ||||
| * | bpo-23699: Use a macro to reduce boilerplate code in rich comparison ↵ | stratakis | 2017-11-02 | 1 | -32/+2 |
| | | | | | functions (GH-793) | ||||
| * | bpo-30070: Fixed leaks and crashes in errors handling in the parser module. ↵ | Serhiy Storchaka | 2017-04-19 | 1 | -52/+79 |
| | | | | | (#1131) | ||||
| * | Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever | Serhiy Storchaka | 2017-01-23 | 1 | -2/+1 |
| | | | | | possible. Patch is writen with Coccinelle. | ||||
| * | Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize | Serhiy Storchaka | 2016-11-20 | 1 | -2/+2 |
| | | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize. | ||||
| * | replace custom validation logic in the parse module with a simple DFA ↵ | Benjamin Peterson | 2016-06-02 | 1 | -2452/+93 |
| | | | | | | | validator (closes #26526) Patch from A. Skrobov. | ||||
| * | Issue #25923: Added more const qualifiers to signatures of static and ↵ | Serhiy Storchaka | 2015-12-25 | 1 | -5/+5 |
| | | | | | private functions. | ||||
| * | Issue #25923: Added the const qualifier to static constant arrays. | Serhiy Storchaka | 2015-12-25 | 1 | -2/+2 |
| | | |||||
| * | Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size. | Serhiy Storchaka | 2015-12-19 | 1 | -1/+1 |
| | | | | | | This allows sys.getsize() to work correctly with their subclasses with __slots__ defined. | ||||
| * | Issue #24791: Fix grammar regression for call syntax: 'g(*a or b)'. | Yury Selivanov | 2015-08-05 | 1 | -3/+6 |
| | | |||||
| * | allow test node after ** in calls (closes #24176) | Benjamin Peterson | 2015-05-16 | 1 | -1/+1 |
| | | |||||
| * | PEP 0492 -- Coroutines with async and await syntax. Issue #24017. | Yury Selivanov | 2015-05-12 | 1 | -12/+103 |
| | | |||||
| * | PEP 448: additional unpacking generalizations (closes #2292) | Benjamin Peterson | 2015-05-06 | 1 | -124/+141 |
| | | | | | Patch by Neil Girdhar. | ||||
| * | Removed unintentional trailing spaces in non-external and non-generated C files. | Serhiy Storchaka | 2015-03-18 | 1 | -1/+1 |
| | | |||||
| * | (Merge 3.3) parser: fix usage of Py_BuildValue() to build a parser error | Victor Stinner | 2014-01-02 | 1 | -1/+1 |
| |\ | | | | | | | Fix typo: "os" format => "Os" | ||||
| | * | parser: fix usage of Py_BuildValue() to build a parser error | Victor Stinner | 2014-01-02 | 1 | -1/+1 |
| | | | | | | | | | Fix typo: "os" format => "Os" | ||||
| | * | Issue #15989: Fix several occurrences of integer overflow | Serhiy Storchaka | 2013-01-19 | 1 | -5/+19 |
| | |\ | | | | | | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277. | ||||
| * | | | Close #11619: The parser and the import machinery do not encode Unicode | Victor Stinner | 2013-08-26 | 1 | -18/+31 |
| | | | | | | | | | | | | | filenames anymore on Windows. | ||||
| * | | | Issue #18408: Fix typo in build_node_tree() of the parser module | Victor Stinner | 2013-07-16 | 1 | -1/+1 |
| | | | | | | | | | | | | | Type "o" format of Py_BuildValue() is invalid: it must be "O". | ||||
| * | | | Issue #18408: parser module: fix error handling in node2tuple() | Victor Stinner | 2013-07-11 | 1 | -28/+52 |
| | | | | | | | | | | | | | Handle PyLong_FromLong() and PyUnicode_FromString() failures | ||||
| * | | | Issue #18408: Fix parser.sequence2st() and parser.tuple2st(): raise MemoryError | Victor Stinner | 2013-07-11 | 1 | -4/+15 |
| | | | | | | | | | | | | | | | | | | | on memory allocation failure Instead of ignoring the memory allocation failure and create invalid objects. | ||||
| * | | | Issue #15989: Fix several occurrences of integer overflow | Serhiy Storchaka | 2013-01-14 | 1 | -5/+19 |
| |/ / | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. | ||||
| * | | Issue #16714: use 'raise' exceptions, don't 'throw'. | Andrew Svetlov | 2012-12-18 | 1 | -3/+3 |
| |\ \ | |/ | | | | | Patch by Serhiy Storchaka. | ||||
| | * | Issue #16714: use 'raise' exceptions, don't 'throw'. | Andrew Svetlov | 2012-12-18 | 1 | -3/+3 |
| | | | | | | | | | Patch by Serhiy Storchaka. | ||||
| * | | Issue #15604: Update uses of PyObject_IsTrue() to check for and handle ↵ | Antoine Pitrou | 2012-08-15 | 1 | -32/+16 |
| |\ \ | |/ | | | | | | | | | errors correctly. Patch by Serhiy Storchaka. | ||||
| | * | Issue #15604: Update uses of PyObject_IsTrue() to check for and handle ↵ | Antoine Pitrou | 2012-08-15 | 1 | -5/+13 |
| | | | | | | | | | | | | | errors correctly. Patch by Serhiy Storchaka. | ||||
| * | | MERGE: Closes #15512: Correct __sizeof__ support for parser | Jesus Cea | 2012-08-03 | 1 | -1/+12 |
| |\ \ | |/ | |||||
| | * | Closes #15512: Correct __sizeof__ support for parser | Jesus Cea | 2012-08-03 | 1 | -1/+12 |
| | | | |||||
| * | | Issue #14741: Merge fix from 3.2. | Mark Dickinson | 2012-05-07 | 1 | -5/+1 |
| |\ \ | |/ | |||||
| | * | Issue #14741: Fix missing support for ellipsis in parser module. | Mark Dickinson | 2012-05-07 | 1 | -5/+1 |
| | | | |||||
| * | | Issue #14697: Merge fix from 3.2. | Mark Dickinson | 2012-05-07 | 1 | -21/+79 |
| |\ \ | |/ | |||||
| | * | Issue #14697: Fix missing parser module support for set displays and set ↵ | Mark Dickinson | 2012-05-07 | 1 | -21/+79 |
| | | | | | | | | | comprehensions. | ||||
| * | | Issue #14701: Merge fix from 3.2. | Mark Dickinson | 2012-05-07 | 1 | -12/+11 |
| |\ \ | |/ | |||||
| | * | Issue #14701: Add missing support for 'raise ... from' in parser module. | Mark Dickinson | 2012-05-07 | 1 | -12/+11 |
| | | | |||||
| * | | Issue #14696: Merge from 3.2 | Mark Dickinson | 2012-04-29 | 1 | -5/+36 |
| |\ \ | |/ | |||||
| | * | Issue #14696: Fix parser module to understand 'nonlocal' declarations. | Mark Dickinson | 2012-04-29 | 1 | -5/+36 |
| | | | |||||
| * | | Issue #9154: Merge fix from 3.2. | Mark Dickinson | 2012-04-29 | 1 | -57/+71 |
| |\ \ | |/ | |||||
| | * | Issue #9154: Fix parser module to understand function annotations. | Mark Dickinson | 2012-04-29 | 1 | -57/+71 |
| | | | |||||
| * | | Implement PEP 380 - 'yield from' (closes #11682) | Nick Coghlan | 2012-01-13 | 1 | -27/+55 |
| | | | |||||
| * | | Rename _Py_identifier to _Py_IDENTIFIER. | Martin v. Löwis | 2011-10-14 | 1 | -3/+3 |
| | | | |||||
| * | | Use identifier API for PyObject_GetAttrString. | Martin v. Löwis | 2011-10-10 | 1 | -3/+6 |
| | | | |||||
| * | | always clear parser error | Benjamin Peterson | 2011-06-06 | 1 | -1/+1 |
| | | | |||||
| * | | only clear the parser error if it's set (closes #12264) | Benjamin Peterson | 2011-06-05 | 1 | -2/+3 |
| | | | |||||
| * | | Issue #10785: Store the filename as Unicode in the Python parser. | Victor Stinner | 2011-04-04 | 1 | -0/+1 |
| |/ | |||||
| * | #11515: Merge with 3.1. | Ezio Melotti | 2011-03-15 | 1 | -1/+1 |
| |\ | |||||
