Visitar URL original
bpo-44369: Improve syntax error for wrongly closed strings by pablogsal · Pull Request #26633 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20211110154544/https://github.com/python/cpython/pull/26633
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-44369: Improve syntax error for wrongly closed strings #26633

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Projects
None yet
7 participants
@pablogsal
Copy link
Member

@pablogsal pablogsal commented Jun 9, 2021 •

https://bugs.python.org/issue44369

@@ -860,6 +860,9 @@ expression_without_invalid[expr_ty]:
invalid_expression:
# !(NAME STRING) is not matched so we don't show this error with some invalid string prefixes like: kf"dsfsdf"
# Soft keywords need to also be ignored because they can be parsed as NAME NAME
| STRING a=(!STRING expression_without_invalid)+ STRING {
RAISE_SYNTAX_ERROR_KNOWN_RANGE( PyPegen_first_item(a, expr_ty), PyPegen_last_item(a, expr_ty),
"invalid syntax. Is this supposed to be part of the string?") }
Copy link
Contributor

@akulakov akulakov Jun 10, 2021

Possibly slightly better phrasing "Is this intended to be..."

Loading

Copy link
Contributor

@erlend-aasland erlend-aasland Jun 14, 2021

+1, @akulakov.

Loading

@github-actions
Copy link

@github-actions github-actions bot commented Jul 15, 2021

This PR is stale because it has been open for 30 days with no activity.

Loading

@github-actions github-actions bot added the stale label Jul 15, 2021
@pablogsal
Copy link
Member Author

@pablogsal pablogsal commented Oct 8, 2021

Ok, I think this is ready :) @isidentical @lysnikolaou

Loading

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

LGTM :)

Loading

Copy link
Contributor

@lysnikolaou lysnikolaou left a comment

Yup!

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment