summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_parser.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.7] bpo-36440: include node names in ParserError messages, instead of ↵Pablo Galindo2019-04-031-0/+16
| | | | | | | | 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-0/+4
| | | | | | | | | 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-7/+22
| | | | | | 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-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-1/+1
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* bpo-30406: Make async and await proper keywords (#1669)Jelle Zijlstra2017-10-061-3/+3
| | | Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
* bpo-30070: Fixed leaks and crashes in errors handling in the parser module. ↵Serhiy Storchaka2017-04-191-0/+81
| | | | (#1131)
* Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.Yury Selivanov2016-09-091-0/+39
| | | | Patch by Ivan Levkivskyi.
* Issue #26754: Undocumented support of general bytes-like objectsSerhiy Storchaka2016-08-061-2/+8
| | | | as path in compile() and similar functions is now deprecated.
* Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded asSerhiy Storchaka2016-06-181-0/+16
|\ | | | | | | an iterable of integers. Now only strings and byte-like objects are accepted.
| * Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded asSerhiy Storchaka2016-06-181-0/+16
| | | | | | | | an iterable of integers. Now only strings and byte-like objects are accepted.
* | Issue #23277: Remove unused sys and os importsBerker Peksag2016-04-241-1/+0
|/ | | | Patch by Jon Dufresne.
* Issue #24791: More tests in test_parserYury Selivanov2015-08-051-0/+2
|
* PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov2015-05-121-0/+16
|
* Issue #9517: Move script_helper to the support package.Berker Peksag2015-05-061-1/+1
| | | | Patch by Christie Wilson.
* PEP 448: additional unpacking generalizations (closes #2292)Benjamin Peterson2015-05-061-0/+12
| | | | Patch by Neil Girdhar.
* Issue #21741: Update 147 test modules to use test discovery.Zachary Ware2015-04-131-12/+1
| | | | | | | I have compared output between pre- and post-patch runs of these tests to make sure there's nothing missing and nothing broken, on both Windows and Linux. The only differences I found were actually tests that were previously *not* run.
* #11963: merge with 3.2.Ezio Melotti2013-03-101-1/+2
|\
| * #11963: fix Windows buildbots.Ezio Melotti2013-03-101-1/+2
| |
* | #11963: merge with 3.2.Ezio Melotti2013-03-091-4/+5
|\ \ | |/
| * #11963: avoid printing messages in test_parser. Initial patch by Éric Araujo.Ezio Melotti2013-03-091-4/+5
| |
* | MERGE: #15512: Remove remnants of debugging codeJesus Cea2012-08-031-2/+0
|\ \ | |/
| * #15512: Remove remnants of debugging codeJesus Cea2012-08-031-2/+0
| |
* | MERGE: Closes #15512: Correct __sizeof__ support for parserJesus Cea2012-08-031-0/+41
|\ \ | |/
| * Closes #15512: Correct __sizeof__ support for parserJesus Cea2012-08-031-0/+41
| |
* | Issue #14741: Merge fix from 3.2.Mark Dickinson2012-05-071-0/+2
|\ \ | |/
| * Issue #14741: Fix missing support for ellipsis in parser module.Mark Dickinson2012-05-071-0/+2
| |
* | Issue #14697: Merge fix from 3.2.Mark Dickinson2012-05-071-0/+23
|\ \ | |/
| * Issue #14697: Fix missing parser module support for set displays and set ↵Mark Dickinson2012-05-071-0/+23
| | | | | | | | comprehensions.
* | Issue #14701: Merge fix from 3.2.Mark Dickinson2012-05-071-0/+8
|\ \ | |/
| * Issue #14701: Add missing support for 'raise ... from' in parser module.Mark Dickinson2012-05-071-0/+8
| |
* | Issue #14696: Merge from 3.2Mark Dickinson2012-04-291-0/+10
|\ \ | |/
| * Issue #14696: Fix parser module to understand 'nonlocal' declarations.Mark Dickinson2012-04-291-0/+10
| |
* | Issue #9154: Merge fix from 3.2.Mark Dickinson2012-04-291-0/+21
|\ \ | |/
| * Issue #9154: Fix parser module to understand function annotations.Mark Dickinson2012-04-291-0/+21
| |
* | Implement PEP 380 - 'yield from' (closes #11682)Nick Coghlan2012-01-131-1/+4
| |
* | only clear the parser error if it's set (closes #12264)Benjamin Peterson2011-06-051-0/+8
|/
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-30/+30
|
* Issue #9130: Validate ellipsis tokens in relative imports.Mark Dickinson2010-07-041-0/+6
|
* Fix symbol numbers in test_parser test.Mark Dickinson2010-07-041-8/+8
|
* Issue #9130: Fix validation of relative imports in parser module.Mark Dickinson2010-07-041-0/+20
|
* Issue #9128: Fix validation of class decorators in parser module.Mark Dickinson2010-07-041-0/+7
|
* Issue #9011: Remove buggy and unnecessary ST->AST compilation codeMark Dickinson2010-06-171-1/+11
| | | | | | | dealing with unary minus applied to a constant. The removed code was mutating the ST, causing a second compilation to fail. (The peephole optimizer already takes care of optimizing this case, so there's no lost optimization opportunity here.)
* Merged revisions 78093 via svnmerge fromGeorg Brandl2010-03-141-1/+0
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78093 | georg.brandl | 2010-02-07 18:03:15 +0100 (So, 07 Feb 2010) | 1 line Remove unused imports in test modules. ........
* Merged revisions 77727 via svnmerge fromEzio Melotti2010-01-241-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
* Merged revisions 76052,76522,76591,76689,76697,76733 via svnmerge fromBenjamin Peterson2009-12-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76052 | gregory.p.smith | 2009-11-01 20:02:38 -0600 (Sun, 01 Nov 2009) | 5 lines see issue1006238, this merges in the following patch to ease cross compiling the printf %zd check. http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/files/python-2.5-cross-printf.patch?rev=1.1&view=markup ........ r76522 | barry.warsaw | 2009-11-25 12:38:32 -0600 (Wed, 25 Nov 2009) | 2 lines Add mktime_tz to __all__. It's documented as being available in email.utils. ........ r76591 | benjamin.peterson | 2009-11-29 16:26:26 -0600 (Sun, 29 Nov 2009) | 4 lines now that deepcopy can handle instance methods, this hack can be removed #7409 Thanks Robert Collins ........ r76689 | benjamin.peterson | 2009-12-06 11:37:48 -0600 (Sun, 06 Dec 2009) | 1 line rewrite translate_newlines for clarity ........ r76697 | benjamin.peterson | 2009-12-06 15:24:30 -0600 (Sun, 06 Dec 2009) | 2 lines fix test_parser from tokenizer tweak ........ r76733 | benjamin.peterson | 2009-12-09 21:37:59 -0600 (Wed, 09 Dec 2009) | 1 line substitute PyDict_Check() for PyObject_IsInstance ........
* Merged revisions 76230 via svnmerge fromBenjamin Peterson2009-11-131-3/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76230 | benjamin.peterson | 2009-11-12 17:39:44 -0600 (Thu, 12 Nov 2009) | 2 lines fix several compile() issues by translating newlines in the tokenizer ........
* fix an ambiguity in the grammar from the implementation of extended unpackingBenjamin Peterson2009-09-271-0/+6
| | | | | | | (one which was strangely "resolved" by pgen) This also kills the unused testlist1 rule and fixes parse tree validation of extended unpacking.
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-9/+9
|
* Merged revisions 73072 via svnmerge fromAntoine Pitrou2009-06-291-0/+1
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r73072 | antoine.pitrou | 2009-05-31 16:20:14 +0200 (dim., 31 mai 2009) | 4 lines Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running regression tests in parallel, shortening the total runtime. ........
* Merged revisions 72924 via svnmerge fromGeorg Brandl2009-05-251-0/+1
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72924 | georg.brandl | 2009-05-25 23:02:56 +0200 (Mo, 25 Mai 2009) | 6 lines Allow multiple context managers in one with statement, as proposed in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics. ........