summaryrefslogtreecommitdiffstats
path: root/Modules/parsermodule.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.7] bpo-36440: include node names in ParserError messages, instead of ↵Pablo Galindo2019-04-031-6/+11
| | | | | | | | numeric IDs (GH-12565) (GH-12671) The error messages in the parser module are referring to numeric IDs for the nodes. To improve readability, use the node names when reporting errors.. (cherry picked from commit cb0748d3939c31168ab5d3b80e3677494497d5e3) Co-authored-by: tyomitch <tyomitch@gmail.com>
* bpo-36256: Fix bug in parsermodule when parsing if statements (GH-12488)Miss Islington (bot)2019-03-211-5/+17
| | | | | | | | | bpo-36256: Fix bug in parsermodule when parsing if statements In the parser module, when validating nodes before starting the parsing with to create a ST in "parser_newstobject" there is a problem that appears when two arcs in the same DFA state has transitions with labels with the same type. For example, the DFA for if_stmt has a state with two labels with the same type: "elif" and "else" (type NAME). The algorithm tries one by one the arcs until the label that starts the arc transition has a label with the same type of the current child label we are trying to accept. In this case, the arc for "elif" comes before the arc for "else"and passes this test (because the current child label is "else" and has the same type as "elif"). This lead to expecting a namedexpr_test (305) instead of a colon (11). The solution is to compare also the string representation (in case there is one) of the labels to see if the transition that we have is the correct one. (cherry picked from commit 9a0000d15d27361eaa47b77600c7c00a9787a894) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519)Miss Islington (bot)2018-04-191-3/+3
| | | | | | Converting with line_info=False and col_info=True crashed before. (cherry picked from commit e5362eaa75a154c6e91c5b1c47719d0a0f5ca48b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-23699: Use a macro to reduce boilerplate code in rich comparison ↵stratakis2017-11-021-32/+2
| | | | functions (GH-793)
* bpo-30070: Fixed leaks and crashes in errors handling in the parser module. ↵Serhiy Storchaka2017-04-191-52/+79
| | | | (#1131)
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-2/+1
| | | | possible. Patch is writen with Coccinelle.
* Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-201-2/+2
| | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
* replace custom validation logic in the parse module with a simple DFA ↵Benjamin Peterson2016-06-021-2452/+93
| | | | | | validator (closes #26526) Patch from A. Skrobov.
* Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka2015-12-251-5/+5
| | | | private functions.
* Issue #25923: Added the const qualifier to static constant arrays.Serhiy Storchaka2015-12-251-2/+2
|
* Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka2015-12-191-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 Selivanov2015-08-051-3/+6
|
* allow test node after ** in calls (closes #24176)Benjamin Peterson2015-05-161-1/+1
|
* PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov2015-05-121-12/+103
|
* PEP 448: additional unpacking generalizations (closes #2292)Benjamin Peterson2015-05-061-124/+141
| | | | Patch by Neil Girdhar.
* Removed unintentional trailing spaces in non-external and non-generated C files.Serhiy Storchaka2015-03-181-1/+1
|
* (Merge 3.3) parser: fix usage of Py_BuildValue() to build a parser errorVictor Stinner2014-01-021-1/+1
|\ | | | | | | Fix typo: "os" format => "Os"
| * parser: fix usage of Py_BuildValue() to build a parser errorVictor Stinner2014-01-021-1/+1
| | | | | | | | Fix typo: "os" format => "Os"
| * Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-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 UnicodeVictor Stinner2013-08-261-18/+31
| | | | | | | | | | | | filenames anymore on Windows.
* | | Issue #18408: Fix typo in build_node_tree() of the parser moduleVictor Stinner2013-07-161-1/+1
| | | | | | | | | | | | Type "o" format of Py_BuildValue() is invalid: it must be "O".
* | | Issue #18408: parser module: fix error handling in node2tuple()Victor Stinner2013-07-111-28/+52
| | | | | | | | | | | | Handle PyLong_FromLong() and PyUnicode_FromString() failures
* | | Issue #18408: Fix parser.sequence2st() and parser.tuple2st(): raise MemoryErrorVictor Stinner2013-07-111-4/+15
| | | | | | | | | | | | | | | | | | on memory allocation failure Instead of ignoring the memory allocation failure and create invalid objects.
* | | Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-141-5/+19
|/ / | | | | | | when result of PyLong_AsLong() narrowed to int without checks.
* | Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-3/+3
|\ \ | |/ | | | | Patch by Serhiy Storchaka.
| * Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-3/+3
| | | | | | | | Patch by Serhiy Storchaka.
* | Issue #15604: Update uses of PyObject_IsTrue() to check for and handle ↵Antoine Pitrou2012-08-151-32/+16
|\ \ | |/ | | | | | | | | errors correctly. Patch by Serhiy Storchaka.
| * Issue #15604: Update uses of PyObject_IsTrue() to check for and handle ↵Antoine Pitrou2012-08-151-5/+13
| | | | | | | | | | | | errors correctly. Patch by Serhiy Storchaka.
* | MERGE: Closes #15512: Correct __sizeof__ support for parserJesus Cea2012-08-031-1/+12
|\ \ | |/
| * Closes #15512: Correct __sizeof__ support for parserJesus Cea2012-08-031-1/+12
| |
* | Issue #14741: Merge fix from 3.2.Mark Dickinson2012-05-071-5/+1
|\ \ | |/
| * Issue #14741: Fix missing support for ellipsis in parser module.Mark Dickinson2012-05-071-5/+1
| |
* | Issue #14697: Merge fix from 3.2.Mark Dickinson2012-05-071-21/+79
|\ \ | |/
| * Issue #14697: Fix missing parser module support for set displays and set ↵Mark Dickinson2012-05-071-21/+79
| | | | | | | | comprehensions.
* | Issue #14701: Merge fix from 3.2.Mark Dickinson2012-05-071-12/+11
|\ \ | |/
| * Issue #14701: Add missing support for 'raise ... from' in parser module.Mark Dickinson2012-05-071-12/+11
| |
* | Issue #14696: Merge from 3.2Mark Dickinson2012-04-291-5/+36
|\ \ | |/
| * Issue #14696: Fix parser module to understand 'nonlocal' declarations.Mark Dickinson2012-04-291-5/+36
| |
* | Issue #9154: Merge fix from 3.2.Mark Dickinson2012-04-291-57/+71
|\ \ | |/
| * Issue #9154: Fix parser module to understand function annotations.Mark Dickinson2012-04-291-57/+71
| |
* | Implement PEP 380 - 'yield from' (closes #11682)Nick Coghlan2012-01-131-27/+55
| |
* | Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-3/+3
| |
* | Use identifier API for PyObject_GetAttrString.Martin v. Löwis2011-10-101-3/+6
| |
* | always clear parser errorBenjamin Peterson2011-06-061-1/+1
| |
* | only clear the parser error if it's set (closes #12264)Benjamin Peterson2011-06-051-2/+3
| |
* | Issue #10785: Store the filename as Unicode in the Python parser.Victor Stinner2011-04-041-0/+1
|/
* #11515: Merge with 3.1.Ezio Melotti2011-03-151-1/+1
|\
| * #11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-151-1/+1
| |
| * Merged revisions 82555 via svnmerge fromMark Dickinson2010-07-041-6/+6
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82555 | mark.dickinson | 2010-07-04 19:38:57 +0100 (Sun, 04 Jul 2010) | 2 lines Issue #9130: Validate ellipsis tokens in relative imports. ........
| * Merged revisions 82552-82553 via svnmerge fromMark Dickinson2010-07-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82552 | mark.dickinson | 2010-07-04 19:11:51 +0100 (Sun, 04 Jul 2010) | 2 lines Issue #9130: Fix validation of relative imports in parser module. ........ r82553 | mark.dickinson | 2010-07-04 19:15:26 +0100 (Sun, 04 Jul 2010) | 1 line Fix symbol numbers in test_parser test. ........