Skip to content

feat: allow new type of bare word string interpolation#212

Closed
blindFS wants to merge 2 commits intonushell:mainfrom
blindFS:unquoted_with_expr
Closed

feat: allow new type of bare word string interpolation#212
blindFS wants to merge 2 commits intonushell:mainfrom
blindFS:unquoted_with_expr

Conversation

@blindFS
Copy link
Contributor

@blindFS blindFS commented Jul 5, 2025

While fixing #199, this PR will increase case number of ts_ls from 3376 to 4111. #185

Not sure we want to land this.

Personally I'd like nushell to forbid all subexpressions in unquoted strings, because that's the job of $""/$'' string interpolation in the first place. But the ease/robustness of parsing it brings won't worth such a huge breaking change, probably we still need this fix in the future and find another way to reduce the compilation time.

@Bahex
Copy link
Member

Bahex commented Jul 5, 2025

I think this is one of the syntax constructs that we don't really need tree-sitter to parse.
Bare string interpolation is primarily for convenience in REPL.

IMO scripts/modules should always prefer the explicit string interpolation syntax.

@blindFS
Copy link
Contributor Author

blindFS commented Jul 5, 2025

That makes sense, yet users may not follow the best practice.

@blindFS blindFS force-pushed the unquoted_with_expr branch from e7d8430 to 64de06a Compare July 7, 2025 21:36
@blindFS blindFS marked this pull request as ready for review July 7, 2025 21:37
@blindFS
Copy link
Contributor Author

blindFS commented Jul 7, 2025

Optimized a little bit, ts_ls cases 3376 -> 3608

WASM comp time: 3m40 -> 5m40.

@fdncred
Copy link
Contributor

fdncred commented Jul 7, 2025

ready to land?

@blindFS
Copy link
Contributor Author

blindFS commented Jul 7, 2025

ready to land?

Not so sure, there's not much room for new fancy syntaxes.

@blindFS blindFS closed this Jul 7, 2025
@blindFS
Copy link
Contributor Author

blindFS commented Jul 7, 2025

Sorry I got the number wrong, 5min40 was from previous commit.

With 3608 cases, it takes more than 15min to compile, which is unacceptable IMO.
Closing this for now.

@fdncred
Copy link
Contributor

fdncred commented Jul 8, 2025

oof, 15min would probably break zed. darn.

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.

3 participants