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

Improve unterminated string interpolation error #313

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

triallax
Copy link
Contributor

@triallax triallax commented Feb 5, 2024

Before, the error span would point to the whole string:

>>> {x} {1"
error: while parsing
  ┌─ <input:16>:1:1
  │
1 │ "{x} {1"
  │ ^^^^^^^^ Unterminated {...} interpolation in this string

Now it only points to the unfinished interpolation:

>>> "{x} {1"
error: while parsing
  ┌─ <input:2>:1:6
  │
1 │ "{x} {1"
  │      ^^ Unterminated string interpolation

How do you think I should go about adding a test for this, or is it not needed?

Before, the error span would point to the whole string:

>>> {x} {1"
error: while parsing
  ┌─ <input:16>:1:1
  │
1 │ "{x} {1"
  │ ^^^^^^^^ Unterminated {...} interpolation in this string

Now it only points to the unfinished interpolation:

>>> "{x} {1"
error: while parsing
  ┌─ <input:2>:1:6
  │
1 │ "{x} {1"
  │      ^^ Unterminated string interpolation
Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good without a test — thank you!

@sharkdp sharkdp merged commit 0de3697 into master Feb 5, 2024
15 checks passed
@sharkdp sharkdp deleted the improve-untermined-interpolation-error branch February 5, 2024 19:40
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