diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-09-16 19:42:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 19:42:00 +0100 |
commit | a5634c406767ef694df49b624adf9cfa6c0d9064 (patch) | |
tree | d0fccb7521e88e3528d5265bf0209f1554fd0098 /Doc | |
parent | acknowledge Weipeng Hong's contributions (GH-22284) (diff) | |
download | cpython-a5634c406767ef694df49b624adf9cfa6c0d9064.tar.gz cpython-a5634c406767ef694df49b624adf9cfa6c0d9064.tar.bz2 cpython-a5634c406767ef694df49b624adf9cfa6c0d9064.zip |
bpo-41746: Add type information to asdl_seq objects (GH-22223)
* Add new capability to the PEG parser to type variable assignments. For instance:
```
| a[asdl_stmt_seq*]=';'.small_stmt+ [';'] NEWLINE { a }
```
* Add new sequence types from the asdl definition (automatically generated)
* Make `asdl_seq` type a generic aliasing pointer type.
* Create a new `asdl_generic_seq` for the generic case using `void*`.
* The old `asdl_seq_GET`/`ast_seq_SET` macros now are typed.
* New `asdl_seq_GET_UNTYPED`/`ast_seq_SET_UNTYPED` macros for dealing with generic sequences.
* Changes all possible `asdl_seq` types to use specific versions everywhere.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/tools/extensions/peg_highlight.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/tools/extensions/peg_highlight.py b/Doc/tools/extensions/peg_highlight.py index 8bc24670fbe..9a2acb7f320 100644 --- a/Doc/tools/extensions/peg_highlight.py +++ b/Doc/tools/extensions/peg_highlight.py @@ -43,7 +43,7 @@ class PEGLexer(RegexLexer): (r"'\W+?'", Text), (r'"\W+?"', Text), ], - "variables": [(_name + _text_ws + "(=)", bygroups(None, None, None),),], + "variables": [(_name + _text_ws + r"(\[.*\])?" + _text_ws + "(=)", bygroups(None, None, None, None, None),),], "invalids": [ (r"^(\s+\|\s+invalid_\w+\s*\n)", bygroups(None)), (r"^(\s+\|\s+incorrect_\w+\s*\n)", bygroups(None)), |