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

faulty handling of single-quoted strings #1

Closed
dimbleby opened this issue Jul 19, 2021 · 3 comments
Closed

faulty handling of single-quoted strings #1

dimbleby opened this issue Jul 19, 2021 · 3 comments

Comments

@dimbleby
Copy link
Contributor

Hi, saw this appear in nvim-treesitter and took it for a spin.

Looks pretty good! But here's a small bug for you: single-quoted strings don't contain escape sequences.

eg see the examples at https://datatracker.ietf.org/doc/html/rfc7950#section-6.1.3.1

"\""  - string containing a double quote
'"'   - string containing a double quote
"\n"  - string containing a newline character
'\n'  - string containing a backslash followed
        by the character n

Maybe the fix is simply to remove this block? (but I don't know what I'm doing in treesitter, don't take my word for it).

While I'm here, I see that in your highlights query you use @string.escape for all sorts of things that aren't string escapes; whereas most of the neovim highlighters use it for an escape sequence - which this parser doesn't expose at all... Seems a bit back-to-front?

@Hubro
Copy link
Owner

Hubro commented Jul 23, 2021

Fixed, ref: #2 (comment)

@Hubro Hubro closed this as completed Jul 23, 2021
@Hubro
Copy link
Owner

Hubro commented Jul 23, 2021

After skimming the RFC on YANG strings, it's clear that the parsing could be way better. It's been added to the TODO list in the README file.

@Hubro Hubro reopened this Jul 23, 2021
@Hubro
Copy link
Owner

Hubro commented Jul 29, 2021

Fixed in #3

@Hubro Hubro closed this as completed Jul 29, 2021
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

No branches or pull requests

2 participants