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

Change error message for unterminated strings with interpolation. #389

Conversation

Zengor
Copy link
Contributor

@Zengor Zengor commented Mar 7, 2024

I was exploring the codebase when I stumbled into what seemed to be the cause of #314.

The parser section handling interpolated strings would error out as UnterminatedStringInterpolation but it was effectively checking for unterminated strings. I couldn't really find a case where the tokenizer would be unable to catch an unterminated interpolation where it wasn't also a case of an unterminated string (let me know if there is one.)

For reference, here's the error message behavior with this PR:

image
image

There might be more edge cases with newlines. The error messages seems mostly fine as is, but the last one is maybe a bit weird:
image
image
image

@sharkdp sharkdp merged commit 51290e5 into sharkdp:master Mar 9, 2024
15 checks passed
@sharkdp
Copy link
Owner

sharkdp commented Mar 9, 2024

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants