Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
efb00e6
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
82120eb
bpo-45759: Better error messages for no-match 'elif'/'else' statement…
thatbirdguythatuknownot Nov 9, 2021
a349649
📜🤖 Added by blurb_it.
blurb-it[bot] Nov 9, 2021
d5fbe1d
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
f1b3b92
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
c9a9df4
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
f7f1f52
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
a03f389
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
7b8eaa9
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
8482969
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
14c7059
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
c663336
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
2347abf
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
92d6323
Update 2021-11-09-00-08-55.bpo-45759.ji7j-W.rst
thatbirdguythatuknownot Nov 9, 2021
3df6948
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
16032ba
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
c7c6b71
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
d9f207f
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
8868bcd
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
6a710ad
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
7c12736
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
bdda2e0
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
f97300e
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
dcc98cc
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
69c507f
bpo-45764: improve error message when missing '(' after 'def' (GH-29484)
thatbirdguythatuknownot Nov 9, 2021
db42a68
bpo-45743: -Wl,-search_paths_first is no longer needed (pythonGH-29464)
thatbirdguythatuknownot Nov 9, 2021
e5813de
bpo-45743: -Wl,-search_paths_first is no longer needed (pythonGH-29464)
thatbirdguythatuknownot Nov 9, 2021
4520d6d
bpo-45743: -Wl,-search_paths_first is no longer needed (pythonGH-29464)
thatbirdguythatuknownot Nov 9, 2021
979d455
bpo-45743: -Wl,-search_paths_first is no longer needed (pythonGH-29464)
thatbirdguythatuknownot Nov 9, 2021
6c1be0b
bpo-45743: Remove workaround for zlib CVE from 2002 (pythonGH-29457)
thatbirdguythatuknownot Nov 9, 2021
a1625e4
bpo-45637: Remove broken fallback in gdb helpers to obtain frame vari…
thatbirdguythatuknownot Nov 9, 2021
ba847f6
bpo-45637: Remove broken fallback in gdb helpers to obtain frame vari…
thatbirdguythatuknownot Nov 9, 2021
0d6b15c
bpo-45764: improve error message when missing '(' after 'def' (python…
thatbirdguythatuknownot Nov 9, 2021
eb0ac65
bpo-45764: improve error message when missing '(' after 'def' (python…
thatbirdguythatuknownot Nov 9, 2021
43dbd07
bpo-45764: improve error message when missing '(' after 'def' (python…
thatbirdguythatuknownot Nov 9, 2021
615f9c2
Update 2021-11-09-00-08-55.bpo-45759.ji7j-W.rst
thatbirdguythatuknownot Nov 9, 2021
7a66404
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
13a53e5
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 9, 2021
46bd6f4
bpo-45723: Remove obsolete AC_EXEEXT from configure.ac (pythonGH-29486)
thatbirdguythatuknownot Nov 9, 2021
00ce320
bpo-45723: Remove obsolete AC_EXEEXT from configure.ac (pythonGH-29486)
thatbirdguythatuknownot Nov 9, 2021
de1db78
bpo-45763: Detect compression build deps in configure (pythonGH-29483)
thatbirdguythatuknownot Nov 9, 2021
7f89dd0
bpo-45763: Detect compression build deps in configure (pythonGH-29483)
thatbirdguythatuknownot Nov 9, 2021
5719fbd
bpo-45763: Detect compression build deps in configure (pythonGH-29483)
thatbirdguythatuknownot Nov 9, 2021
a432138
bpo-45763: Detect compression build deps in configure (pythonGH-29483)
thatbirdguythatuknownot Nov 9, 2021
31b79f7
bpo-45763: Detect compression build deps in configure (pythonGH-29483)
thatbirdguythatuknownot Nov 9, 2021
f22b932
bpo-45763: Detect compression build deps in configure (pythonGH-29483)
thatbirdguythatuknownot Nov 9, 2021
123272a
Factor-out constant calculation. (pythonGH-29491)
thatbirdguythatuknownot Nov 9, 2021
ef7e611
Create 2021-11-08-21-53-11.bpo-45732.idl5kx.rst
thatbirdguythatuknownot Nov 9, 2021
ab18fc9
bpo-45732: Update bundled Tcl/Tk on Windows to 8.6.12 (pythonGH-29477)
thatbirdguythatuknownot Nov 9, 2021
5357954
bpo-45732: Update bundled Tcl/Tk on Windows to 8.6.12 (pythonGH-29477)
thatbirdguythatuknownot Nov 9, 2021
5e2c005
bpo-45757: Fix bug where dis produced an incorrect oparg on EXTENDED_…
thatbirdguythatuknownot Nov 9, 2021
e4a8c2b
bpo-45757: Fix bug where dis produced an incorrect oparg on EXTENDED_…
thatbirdguythatuknownot Nov 9, 2021
4449921
bpo-45757: Fix bug where dis produced an incorrect oparg on EXTENDED_…
thatbirdguythatuknownot Nov 9, 2021
2525eee
bpo-45220: Ensure RT_MANIFEST is defined when compiling Windows resou…
thatbirdguythatuknownot Nov 9, 2021
607daf1
bpo-45220: Ensure RT_MANIFEST is defined when compiling Windows resou…
thatbirdguythatuknownot Nov 9, 2021
a85b5ec
bpo-45220: Ensure RT_MANIFEST is defined when compiling Windows resou…
thatbirdguythatuknownot Nov 9, 2021
9cbccc5
bpo-45220: Ensure RT_MANIFEST is defined when compiling Windows resou…
thatbirdguythatuknownot Nov 9, 2021
23df11d
bpo-45220: Ensure RT_MANIFEST is defined when compiling Windows resou…
thatbirdguythatuknownot Nov 9, 2021
71e440a
bpo-45220: Ensure RT_MANIFEST is defined when compiling Windows resou…
thatbirdguythatuknownot Nov 9, 2021
be6e319
bpo-45723: Remove dead code for obsolete `--with-dyld` option (python…
thatbirdguythatuknownot Nov 9, 2021
30388b9
bpo-45723: Remove dead code for obsolete `--with-dyld` option (python…
thatbirdguythatuknownot Nov 9, 2021
4e91ea4
bpo-45701: Improve documentation for *typed* parameter (pythonGH-29498)
thatbirdguythatuknownot Nov 9, 2021
490cf0b
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
8b02638
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
71c259a
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
548373d
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
ccc4e43
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
44785e6
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
e937253
bpo-45723: Remove dead code for obsolete `--with-dyld` option (GH-29500)
thatbirdguythatuknownot Nov 9, 2021
4d96e49
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
86e565a
bpo-45723: Remove dead code for obsolete `--with-dyld` option (GH-29500)
thatbirdguythatuknownot Nov 9, 2021
ea4696f
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
3f7858a
bpo-45743: Remove workaround for zlib CVE from 2002 (pythonGH-29457)
thatbirdguythatuknownot Nov 9, 2021
a96134c
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
1cd5648
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
d519575
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
945245d
Fix conflicts
thatbirdguythatuknownot Nov 9, 2021
588293e
Fix conflicts
thatbirdguythatuknownot Nov 10, 2021
fa2d5c8
Fix conflicts
thatbirdguythatuknownot Nov 10, 2021
9c1ef13
Fix conflicts
thatbirdguythatuknownot Nov 10, 2021
f98e447
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 10, 2021
b79248f
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
thatbirdguythatuknownot Nov 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-45759: Better error messages for non-matching 'elif'/'else' state…
…ments (GH-29481)
  • Loading branch information
thatbirdguythatuknownot authored Nov 9, 2021
commit 848296965becfeca012622e6ea33c987a5adb0c0
6 changes: 2 additions & 4 deletions Grammar/python.gram
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ simple_stmt[stmt_ty] (memo):
| &'nonlocal' nonlocal_stmt

compound_stmt[stmt_ty]:
| invalid_compound_stmt
| &('def' | '@' | ASYNC) function_def
| &'if' if_stmt
| &('class' | '@') class_def
Expand Down Expand Up @@ -1052,9 +1051,6 @@ func_type_comment[Token*]:
# ========================= START OF INVALID RULES =======================

# From here on, there are rules for invalid syntax with specialised error messages
invalid_compound_stmt:
| a='elif' named_expression { RAISE_SYNTAX_ERROR_STARTING_FROM(a, "'elif' does not match an 'if' here") }
| a='else' named_expression { RAISE_SYNTAX_ERROR_STARTING_FROM(a, "'else' does not match a 'if'/'while'/'for' here") }
invalid_arguments:
| a=args ',' '*' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "iterable argument unpacking follows keyword argument unpacking") }
| a=expression b=for_if_clauses ',' [args | expression for_if_clauses] {
Expand Down Expand Up @@ -1130,6 +1126,8 @@ invalid_del_stmt:
RAISE_SYNTAX_ERROR_INVALID_TARGET(DEL_TARGETS, a) }
invalid_block:
| NEWLINE !INDENT { RAISE_INDENTATION_ERROR("expected an indented block") }
| a='elif' named_expression { RAISE_SYNTAX_ERROR_STARTING_FROM(a, "'elif' does not match an 'if' here") }
| a='else' named_expression { RAISE_SYNTAX_ERROR_STARTING_FROM(a, "'else' does not match a 'if'/'while'/'for' here") }
invalid_comprehension:
| ('[' | '(' | '{') a=starred_expression for_if_clauses {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "iterable unpacking cannot be used in comprehension") }
Expand Down