This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Support -d flag in the new parser
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, lys.nikolaou, miss-islington, pablogsal
Priority: normal Keywords: patch

Created on 2020-05-24 01:41 by pablogsal, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20340 merged pablogsal, 2020-05-24 01:43
PR 20392 merged miss-islington, 2020-05-25 17:39
PR 20393 merged pablogsal, 2020-05-25 18:36
PR 20394 merged miss-islington, 2020-05-25 19:17
Messages (6)
msg369763 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-05-24 01:41
Python has a (mostly unknown) -d flag that can only be used in debug builds that emit some debug output for the old parser. The new parser does not support such flag. This is very useful when playing with the grammar as it helps enormously to inspect how the parser has behaved and what rules have accepted/rejected in its path.
msg369764 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-05-24 01:44
A piece of the output for the string "1 + 1" with PR 20340:

       > star_expressions[0-0]: star_expression ','
       ✗ star_expressions[0-0]: star_expression ',' failed!
       > star_expressions[0-0]: star_expression
       ✓ star_expressions[0-3]: star_expression
       > augassign[3-3]: '+='
       ✗ augassign[3-3]: '+=' failed!
       > augassign[3-3]: '-='
       ✗ augassign[3-3]: '-=' failed!
       > augassign[3-3]: '*='
       ✗ augassign[3-3]: '*=' failed!
       > augassign[3-3]: '@='
       ✗ augassign[3-3]: '@=' failed!
       > augassign[3-3]: '/='
       ✗ augassign[3-3]: '/=' failed!
       > augassign[3-3]: '%='
       ✗ augassign[3-3]: '%=' failed!
       > augassign[3-3]: '&='
       ✗ augassign[3-3]: '&=' failed!
       > augassign[3-3]: '|='
       ✗ augassign[3-3]: '|=' failed!
       > augassign[3-3]: '^='
       ✗ augassign[3-3]: '^=' failed!
       > augassign[3-3]: '<<='
       ✗ augassign[3-3]: '<<=' failed!
       > augassign[3-3]: '>>='
       ✗ augassign[3-3]: '>>=' failed!
       > augassign[3-3]: '**='
       ✗ augassign[3-3]: '**=' failed!
       > augassign[3-3]: '//='
       ✗ augassign[3-3]: '//=' failed!
      ✗ invalid_assignment[0-0]: star_expressions augassign (yield_expr | star_expressions) failed!
     ✗ assignment[0-0]: invalid_assignment failed!
    ✗ small_stmt[0-0]: assignment failed!
    > small_stmt[0-0]: star_expressions
     > star_expressions[0-0]: star_expression ((',' star_expression))+ ','?
      > _loop1_71[3-3]: (',' star_expression)
       > _tmp_139[3-3]: ',' star_expression
       ✗ _tmp_139[3-3]: ',' star_expression failed!
      ✗ _loop1_71[3-3]: (',' star_expression) failed!
     ✗ star_expressions[0-0]: star_expression ((',' star_expression))+ ','? failed!
     > star_expressions[0-0]: star_expression ','
     ✗ star_expressions[0-0]: star_expression ',' failed!
     > star_expressions[0-0]: star_expression
     ✓ star_expressions[0-3]: star_expression
    ✓ small_stmt[0-3]: star_expressions
   ✓ simple_stmt[0-4]: small_stmt !';' NEWLINE
  ✓ statement_newline[0-4]: simple_stmt
 ✓ interactive[0-4]: statement_newline
2
 > interactive[0-0]: statement_newline
msg369899 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-05-25 17:38
New changeset 800a35c623bbcdb5793c7d7a4974524286311479 by Pablo Galindo in branch 'master':
bpo-40750: Support -d flag in the new parser (GH-20340)
https://github.com/python/cpython/commit/800a35c623bbcdb5793c7d7a4974524286311479
msg369901 - (view) Author: miss-islington (miss-islington) Date: 2020-05-25 17:58
New changeset 82da2c3eb4d69b55d9e300ab5d9c1d22bd09b9cd by Miss Islington (bot) in branch '3.9':
bpo-40750: Support -d flag in the new parser (GH-20340)
https://github.com/python/cpython/commit/82da2c3eb4d69b55d9e300ab5d9c1d22bd09b9cd
msg369908 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-05-25 19:17
New changeset deb4355a37e41edf1199920789fe9572c1fb43c2 by Pablo Galindo in branch 'master':
bpo-40750: Do not expand the new parser debug flags if Py_BUILD_CORE is not defined (GH-20393)
https://github.com/python/cpython/commit/deb4355a37e41edf1199920789fe9572c1fb43c2
msg369913 - (view) Author: miss-islington (miss-islington) Date: 2020-05-25 19:38
New changeset 31084be618b6b7602d58e4d21ceef2e65ed8ef1b by Miss Islington (bot) in branch '3.9':
bpo-40750: Do not expand the new parser debug flags if Py_BUILD_CORE is not defined (GH-20393)
https://github.com/python/cpython/commit/31084be618b6b7602d58e4d21ceef2e65ed8ef1b
History
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84927
2020-05-25 19:38:03miss-islingtonsetmessages: + msg369913
2020-05-25 19:17:30miss-islingtonsetpull_requests: + pull_request19657
2020-05-25 19:17:19pablogsalsetmessages: + msg369908
2020-05-25 18:36:11pablogsalsetpull_requests: + pull_request19656
2020-05-25 17:58:10miss-islingtonsetmessages: + msg369901
2020-05-25 17:39:25miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request19655
2020-05-25 17:39:00pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-05-25 17:38:52pablogsalsetmessages: + msg369899
2020-05-24 01:45:02pablogsalsetnosy: + gvanrossum, lys.nikolaou
2020-05-24 01:44:41pablogsalsetmessages: + msg369764
2020-05-24 01:43:13pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request19608
2020-05-24 01:41:37pablogsalcreate