bpo-42997: Improve error message for missing : before suites by pablogsal · Pull Request #24292 · python/cpython

@pablogsal

@lysnikolaou

@pablogsal pablogsal marked this pull request as ready for review

Jan 31, 2021
* Add to the peg generator a new directive ('&&') that allows to expect
  a token and hard fail the parsing if the token is not found. This
  allows to quickly emmit syntax errors for missing tokens.

* Use the new grammar element to hard-fail if the ':' is missing before
  suites.

@blurb-it @pablogsal

@blurb-it @pablogsal

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>

@pablogsal

@pablogsal

@gvanrossum

@lysnikolaou

@pablogsal pablogsal merged commit 58fb156 into python:master

Feb 2, 2021

11 checks passed

Check if generated files are up to date

Details

Azure Pipelines PR #20210201.15 succeeded

Details

Travis CI - Pull Request Build Passed

Details

bedevere/issue-number Issue number 42997 found

Details

bedevere/news News entry found in Misc/NEWS.d

ncoghlan added a commit to ncoghlan/cpython that referenced this pull request

Feb 8, 2021
…H-24292)

* Add to the peg generator a new directive ('&&') that allows to expect
  a token and hard fail the parsing if the token is not found. This
  allows to quickly emmit syntax errors for missing tokens.

* Use the new grammar element to hard-fail if the ':' is missing before
  suites.

adorilson added a commit to adorilson/cpython that referenced this pull request

Mar 13, 2021
…H-24292)

* Add to the peg generator a new directive ('&&') that allows to expect
  a token and hard fail the parsing if the token is not found. This
  allows to quickly emmit syntax errors for missing tokens.

* Use the new grammar element to hard-fail if the ':' is missing before
  suites.

Harry-Lees added a commit to Harry-Lees/cpython that referenced this pull request

Mar 28, 2021
…H-24292)

* Add to the peg generator a new directive ('&&') that allows to expect
  a token and hard fail the parsing if the token is not found. This
  allows to quickly emmit syntax errors for missing tokens.

* Use the new grammar element to hard-fail if the ':' is missing before
  suites.