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

Add child nodes for the contents of a string? #12

Closed
connorlay opened this issue Feb 5, 2022 · 1 comment · Fixed by #13
Closed

Add child nodes for the contents of a string? #12

connorlay opened this issue Feb 5, 2022 · 1 comment · Fixed by #13

Comments

@connorlay
Copy link

Howdy! As you know, I am working on integrating this grammar with neovim https://github.com/J3RN/tree-sitter-gleam/issues/1, during which I realized there is no node for string escape sequences. Without this node, I cannot highlight escape sequences similar to what I did with the nvim-treesitter Elixir highlight queries.

For example, tree-sitter-elixir parses:

"foo\nbar"

as the following tree of nodes:

(string
  quoted_start: """
  (quoted_content)
  (escape_sequence)
  (quoted_content)
  quoted_end: """)

I'm curious what you think!

@J3RN
Copy link
Member

J3RN commented Feb 9, 2022

This is an interesting idea. We will, likely, eventually, have to do more string introspection seeing as string interpolation is planned, so this seems like a reasonable place to start. I'll probably not have time to look at this until the weekend, so you're welcome to give it a go if you'll have time sooner 😁

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.

2 participants