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

each_start_expr cannot parse array of strings #48

Open
clarkf opened this issue Jan 4, 2024 · 0 comments · May be fixed by #50
Open

each_start_expr cannot parse array of strings #48

clarkf opened this issue Jan 4, 2024 · 0 comments · May be fixed by #50

Comments

@clarkf
Copy link

clarkf commented Jan 4, 2024

I tried to parse the input from section 6.5 - Group inputs of the svelte tutorial. Emacs' query explorer showed that the query failed, and I was able to reduce it down to a simpler case:

{#each ["a", "b"] as elem}
  {elem}
{/each}

It doesn't seem to fail with a single element, or multiple non-strings ([a, b, c, 1, 2, 3] works fine).

I know this is mostly an neovim focused project, so forgive the parens, but emacs treesit-explore-mode reports the parse result as:

(each_statement
  (each_start_expr { # (special_block_keyword)
   (ERROR (ERROR) " (ERROR) " (ERROR))
   (raw_text_each) (as) (raw_text_expr) })
  (expression { (raw_text_expr) })
  (each_end_expr { / (special_block_keyword) }))

I was able to reproduce this issue (I think) under nivm 0.9.4 and nvim-treesitter 8ae4080. Syntax highlighting got weird, and after a :TSUpdate svelte, the interior of the {#each} was un-highlighted.

@savetheclocktower savetheclocktower linked a pull request Jan 8, 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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant