Skip to content

fix for comment in interpolated string#252

Open
fdncred wants to merge 2 commits into
nushell:mainfrom
fdncred:update_comment_regex_251
Open

fix for comment in interpolated string#252
fdncred wants to merge 2 commits into
nushell:mainfrom
fdncred:update_comment_regex_251

Conversation

@fdncred

@fdncred fdncred commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This PR closes #251 by updating the comment regex to:
to

comment: _ => seq('#', /[^)\]}\n]*/),

meaning comments start with # and stop at ), ], and }. The trade-off is that ), ], and } can no longer appear in comments on the same line as #.

It's probably an acceptable trade-off.

The problem was strings like $"foo (## some comment) bar" weren't being interpreted correctly and the tree-sitter parser was basically breaking and didn't know what to do.

  • I also made some minor changes the the package.json so tree-sitter test would work better for me.
  • I updated the .gitignore to ignore .DS_Store on macs
  • I also added a test for string interpolated evaluated comments evaluating to nothing. LOL
  • I had to set ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION to true in the CI to get this to work since there's no new action that uses Node 24 yet.

@fdncred

fdncred commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

ugh, apparently this fix breaks other things. i'll look a bit more before giving up. :)

@blindFS

blindFS commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Should be much easier if there's this feature of ts

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.

Parse error of multiline string interpolation with #

2 participants