{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
bpo-40334: PEP 617: New PEG parser for CPython #19503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
57f78dd
Run CI in pegen branch as well (#3)
pablogsal 5c0c31f
Merge steps 1-3 and 6 into 'pegen' branch (#8)
gvanrossum eab06f3
Fall back to a set for done in collect_todo (#9)
lysnikolaou 91427a4
Add Github Actions for pegen tests in Tools/peg_generator (#12)
lysnikolaou cccfd3d
Allow expressions in yield_expression rule and rename it to annotated…
lysnikolaou 51611b4
Copy .clang-format from pegen project, to guide 'make format-c'
gvanrossum 0c7a382
Expose a C API and a Python-level module for pegen (#11)
lysnikolaou 0cffa81
Run clang-format over peg_parser/pegen.c
gvanrossum e960c15
Run clang-format over Parser/pegen/pegen.c
gvanrossum 89c2385
Run clang-format over Modules/peg_parser.c
gvanrossum 1d2b107
Ifdef-out token_name() to silence compiler output noise warning
gvanrossum 12f6175
Merge branch 'master' into pegen
gvanrossum 59abf20
Make Ubuntu tests pass; disable Win and Mac tests (#19)
lysnikolaou 14ae717
Rewrite run_parser* functions to always return a mod_ty (#17)
lysnikolaou bfa7445
Rewrite exported function (#21)
lysnikolaou 4c4917b
Merge remote-tracking branch 'upstream/master' into pegen
lysnikolaou 479bd95
Remove all unnecessary code from Tools/peg_generator; only keep the g…
lysnikolaou 4410737
Support for PEP 614 (#24)
pablogsal b984cad
Re-enable MacOS test on Github Actions (#26)
lysnikolaou 919a669
Add memoization control (#28)
gvanrossum 55101cb
Fold long lines in metagrammar
gvanrossum ca3eeca
Update Parser/pegen/parse.c after addition of memoization flag (#28)
lysnikolaou 33b77af
Add a command-line flag and an environment variable to enable pegen (…
lysnikolaou 3aa1dd4
Add missing possible start rules in python.gram (#32)
lysnikolaou b8ce9a1
Merge remote-tracking branch 'upstream/master' into pegen
pablogsal f3d8888
Update grammar to account for _Py_keyword changes (#40)
pablogsal 242114a
Merge remote-tracking branch 'upstream/master' into pegen
pablogsal 35bedc2
Add new C API functions PyPegen_*FromFileObject and use them in inter…
lysnikolaou 74736fe
Memoize some rules to avoid exponential time in deep nesting (#39)
pablogsal 4bc4e7c
Run tests with pegen enabled on CI (#41)
lysnikolaou 6ba7869
Improve SyntaxError message when an ERRORTOKEN is returned by the tok…
lysnikolaou ee7b2cf
Use FILE pointer instead of filename string to pass file to parser (#52)
lysnikolaou c12c227
Add start_mark variable in loop rules (#51)
lysnikolaou 18743bc
Simplify grammar rules around ASYNC (#53)
gvanrossum 3359dab
Throw SyntaxError when parsing a STRING throws an exception (#54)
lysnikolaou 071df9c
Add use_peg field to sys.flags (#55)
lysnikolaou b1f0bd8
Improve error reporting and disallow f(**kwargs, *args) (#46)
pablogsal 0627990
Propagate errors from the tokenizer (#57)
pablogsal f233194
Output more descriptive error messages for named expressions (#56)
lysnikolaou 1dcdc4b
Output more descriptive error messages for invalid assignments (#59)
lysnikolaou 8da51f1
Avoid memory leak in Parser_New (#62)
lysnikolaou 494114e
Fix SEGFAULT in test_fstring (#61)
lysnikolaou 99a8e2f
Provide location info on SyntaxError due to EOLS or EOFS errors (#60)
lysnikolaou 502dfb7
Merge remote-tracking branch 'upstream/master' into pegen
lysnikolaou e43370e
Ignore encoding cookie when that's necessary (#68)
lysnikolaou a7f962d
Silence compiler warnings about unused variables on Linux (#70)
lysnikolaou 9c36a0f
Merge remote-tracking branch 'upstream/master' into pegen
lysnikolaou 9952d03
Refactor illegal syntax rules to avoid invalid error messages (#72)
lysnikolaou b684233
Create a new rule for STRING+ and memoize it (#67)
lysnikolaou 45d6bf7
Fix type of strings rule (#73)
lysnikolaou a54e89e
Skip one test_traceback test, where pegen is better (#74)
lysnikolaou d386c70
Skip non-critical test_string_literals test that fails (#75)
lysnikolaou 1169db2
Add script that reproduces all the PEP benchmarks (#71)
lysnikolaou e764fb2
Merge remote-tracking branch 'upstream/master' into pegen
lysnikolaou dad5249
Fix calls to _PyInterpreterState_GET after merge
lysnikolaou 6f6354f
Generate specialized error message for invalid string prefixes (#77)
lysnikolaou b623006
Compress data/xxl.py and decompress on demand (#79)
pablogsal 1a03e3e
Use the new parser by default (#81)
pablogsal 3af6081
Rename pegen functions to start with the _PyPegen_ prefix (#80)
lysnikolaou e3c95c9
Compile pegen in windows (#82)
pablogsal d7e4b5c
Remove whitespace to make patchcheck happy (#87)
pablogsal ffee25f
Rename the peg_parser module to _peg_parser (#86)
pablogsal b625797
Fix travis errors (#88)
pablogsal 85f7400
Remove the -p command line option and add a new -X oldparser option i…
lysnikolaou a4c58b5
Disallow trailing comma in from-imports (#97)
lysnikolaou 04062ed
Add blurb
gvanrossum f1afe08
Use pegen in the symtable and fix symtable test errors (#102)
pablogsal b8899ec
Merge branch 'master' into pegen
gvanrossum 975baa4
Only optimize __debug__ when ctx==Load (#106)
gvanrossum 298650c
Reproduce current parser's error messages for indentation errors (#107)
lysnikolaou de6edfb
Add more tokenize errors (#105)
pablogsal ef0f6fa
Normalize unicode identifiers (#108)
pablogsal a9d309c
Raise IndentationError on indentation-related errors (#111)
lysnikolaou 871cecb
Copy most fixes from #96 except for the part that uses pegen for comp…
gvanrossum ecef99b
Temporarily suppress two failures in test_eof.py (one even with old p…
gvanrossum 443afb1
Use col_offset when raising an E_DEDENT error (#116)
lysnikolaou 87460d2
Use pegen in compile and other functions in pythonrun.c (#96)
lysnikolaou 14ab84b
Don't use longjmp and check for the error indicator on every rule (#119)
pablogsal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add a command-line flag and an environment variable to enable pegen (#29
- Loading branch information
commit 33b77af56e50fbc150b704ab48bbdd424f021fe7
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -252,6 +252,12 @@ Miscellaneous options | |
| options). See also :envvar:`PYTHONDEBUG`. | ||
|
|
||
|
|
||
| .. cmdoption:: -p old|new | ||
|
|
||
| Use the new PEG parser, if arg is ``new``. If arg is ``old``, use the old | ||
| parser. See also :envvar:`PYTHONPARSER`. | ||
|
|
||
|
|
||
| .. cmdoption:: -E | ||
|
|
||
| Ignore all :envvar:`PYTHON*` environment variables, e.g. | ||
|
|
@@ -574,6 +580,13 @@ conflict. | |
| :option:`-d` multiple times. | ||
|
|
||
|
|
||
| .. envvar:: PYTHONPARSER | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. versionadded tag can be added for new environment variable. |
||
|
|
||
| If this is set to ``new``, the new PEG parser is used. If it is set to | ||
| ``old``, the old parser is used. Other values are ignored. See also the | ||
| :option:`-p` option. | ||
|
|
||
|
|
||
| .. envvar:: PYTHONINSPECT | ||
|
|
||
| If this is set to a non-empty string it is equivalent to specifying the | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can’t perform that action at this time.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
versionadded tag can be added for new option.