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

Quotes inside interpolations can terminate the interpolated string #12722

Open
panicbit opened this issue May 1, 2024 · 1 comment · May be fixed by #12855
Open

Quotes inside interpolations can terminate the interpolated string #12722

panicbit opened this issue May 1, 2024 · 1 comment · May be fixed by #12855
Labels
🐛 bug Something isn't working investigate this requires investigation parser Issues related to parsing

Comments

@panicbit
Copy link
Contributor

panicbit commented May 1, 2024

Describe the bug

When interpolating something into a string, patterns like '"' (single quote, double quote, single quote) can terminate the interpolated string.

How to reproduce

  1. $"('"')"

In interactive mode, nushell asks for more input.
In non-interactive mode nushell errors out with:

Error: nu::parser::unexpected_eof

  × Unexpected end of code.
   ╭─[/tmp/test.nu:2:1]
 1 │ $"('"')"
   ╰────

Adding a ' to the end ($"('"')"') results in the output ""'.

Expected behavior

Output: "

Screenshots

No response

Configuration

key value
version 0.93.0
major 0
minor 93
patch 0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.77.2 (25ef9e3d8 2024-04-09)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.77.2 (e52e36006 2024-03-26)
build_time 2024-05-01 16:35:43 +02:00
build_rust_channel release
allocator mimalloc
features dataframe, default, sqlite, static-link-openssl, system-clipboard, trash, which
installed_plugins formats

Additional context

No response

@panicbit panicbit added the needs-triage An issue that hasn't had any proper look label May 1, 2024
@devyn devyn added 🐛 bug Something isn't working investigate this requires investigation parser Issues related to parsing and removed needs-triage An issue that hasn't had any proper look labels May 2, 2024
@devyn
Copy link
Contributor

devyn commented May 2, 2024

Yep, that doesn't seem right. Will have to look at the parse tree.

@merelymyself merelymyself linked a pull request May 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working investigate this requires investigation parser Issues related to parsing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants