Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d18635

Browse files
hugovkrffontenelleAA-Turner
authored
[3.13] Remove trailing whitespace from python.gram (#133858) (#133991)
Co-authored-by: Rafael Fontenelle <[email protected]> Co-authored-by: Adam Turner <[email protected]>
1 parent e1cc789 commit 5d18635

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ repos:
3939
exclude: Lib/test/tokenizedata/coding20731.py
4040
- id: trailing-whitespace
4141
types_or: [c, inc, python, rst]
42+
- id: trailing-whitespace
43+
files: '\.(gram)$'
4244

4345
- repo: https://github.com/woodruffw/zizmor-pre-commit
4446
rev: v1.6.0

Grammar/python.gram

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ _PyPegen_parse(Parser *p)
7979
# ~
8080
# Commit to the current alternative, even if it fails to parse.
8181
# &&e
82-
# Eager parse e. The parser will not backtrack and will immediately
82+
# Eager parse e. The parser will not backtrack and will immediately
8383
# fail with SyntaxError if e cannot be parsed.
8484
#
8585

@@ -640,7 +640,7 @@ type_alias[stmt_ty]:
640640
# Type parameter declaration
641641
# --------------------------
642642

643-
type_params[asdl_type_param_seq*]:
643+
type_params[asdl_type_param_seq*]:
644644
| invalid_type_params
645645
| '[' t=type_param_seq ']' {
646646
CHECK_VERSION(asdl_type_param_seq *, 12, "Type parameter lists are", t) }
@@ -1307,13 +1307,13 @@ invalid_group:
13071307
invalid_import:
13081308
| a='import' ','.dotted_name+ 'from' dotted_name {
13091309
RAISE_SYNTAX_ERROR_STARTING_FROM(a, "Did you mean to use 'from ... import ...' instead?") }
1310-
| 'import' token=NEWLINE {
1310+
| 'import' token=NEWLINE {
13111311
RAISE_SYNTAX_ERROR_STARTING_FROM(token, "Expected one or more names after 'import'") }
13121312

13131313
invalid_import_from_targets:
13141314
| import_from_as_names ',' NEWLINE {
13151315
RAISE_SYNTAX_ERROR("trailing comma not allowed without surrounding parentheses") }
1316-
| token=NEWLINE {
1316+
| token=NEWLINE {
13171317
RAISE_SYNTAX_ERROR_STARTING_FROM(token, "Expected one or more names after 'import'") }
13181318

13191319
invalid_with_stmt:
@@ -1437,5 +1437,5 @@ invalid_factor:
14371437
invalid_type_params:
14381438
| '[' token=']' {
14391439
RAISE_SYNTAX_ERROR_STARTING_FROM(
1440-
token,
1440+
token,
14411441
"Type parameter list cannot be empty")}

0 commit comments

Comments
 (0)