cpython/Tools/peg_generator/pegen
Łukasz Langa 88f4ec88e2
[3.9] bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters (GH-28993) (#29071)
There are two errors that this commit fixes:

* The parser was not correctly computing the offset and the string
  source for E_LINECONT errors due to the incorrect usage of strtok().
* The parser was not correctly unwinding the call stack when a tokenizer
  exception happened in rules involving optionals ('?', [...]) as we
  always make them return valid results by using the comma operator. We
  need to check first if we don't have an error before continuing..
(cherry picked from commit a106343f63)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

NOTE: unlike the cherry-picked original, this commit points at a crazy location
due to a bug in the tokenizer that required a big refactor in 3.10 to fix.
We are leaving as-is for 3.9.
2021-10-20 18:51:13 +02:00
..
__init__.py
__main__.py bpo-40334: Refactor peg_generator to receive a Tokens file when building c code (GH-19745) 2020-04-28 13:11:55 +01:00
ast_dump.py Fix some scripts in the peg generator folder (GH-19853) 2020-05-02 05:23:06 +01:00
build.py Clean up unused imports for the peg generator module (GH-19891) 2020-05-04 03:03:05 +01:00
c_generator.py [3.9] bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters (GH-28993) (#29071) 2021-10-20 18:51:13 +02:00
first_sets.py [3.9] Fix typos in the Tools directory (GH-28769) (GH-28800) 2021-10-07 17:31:24 +02:00
grammar.py Clean up unused imports for the peg generator module (GH-19891) 2020-05-04 03:03:05 +01:00
grammar_parser.py bpo-40334: regenerate metaparser as part of regen-all (GH-19854) 2020-05-02 05:23:39 +01:00
grammar_visualizer.py Clean up unused imports for the peg generator module (GH-19891) 2020-05-04 03:03:05 +01:00
keywordgen.py [3.9] Include soft keywords in keyword.py (GH-20877). (GH-20880) 2020-06-15 04:31:05 +01:00
metagrammar.gram
parser.py
parser_generator.py [3.9] Fix typing problems reported by mypy in pegen (GH-20297) (GH-20300) 2020-05-21 22:09:43 +01:00
python_generator.py [3.9] Fix 'gather' rules in the python parser generator (GH-22021) (GH-22080) 2020-09-03 16:35:36 +01:00
sccutils.py
testutil.py bpo-40750: Support -d flag in the new parser (GH-20340) 2020-05-25 10:58:03 -07:00
tokenizer.py