-
Notifications
You must be signed in to change notification settings - Fork 45
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
escape_sequence node is omitting information #45
Comments
Using https://ikatyang.github.io/tree-sitter-yaml/ to reproduce, your fixture parses as correct CST tree
|
You are right, it parses correctly... but it still omits information. Another example to make myself clear: Using the same tool, https://ikatyang.github.io/tree-sitter-yaml/, if you try to parse:
It will generate a That doesn't happen when trying to force a keyword into a string like my first example ( That's why I'm saying that the parser omits information. |
Exactly. parser detected that
Because the
I don't see your point. It does not omit anything. It parses what it sees. If it intercept the escape sequence in double quote scalar it will parse it, it if doesn't see any escape sequences in double quote scalar, it does not produce any CST nodes. |
You are right when you say that the Another example
In this case there is a child node that points to Graphical representation of the example: As you can see there is a child node that points to a newline but the rest of the source string is nowhere to be found. |
Right, I understand what you're saying now. I'm not an author of this library, but I use grammar to create syntactic analyzer on top of the CST, that this grammar produces. In the case of I don't care if the |
Oh, that's interesting... I'll look to see if I can implement something similar. |
Np, just try to think of it, as if There will be tools for other languages in their standard or vendor libraries I'm sure. There are actually more things that needs to be done for getting value out of |
When trying to force a keyword or number into a string as in the following example:
The parsed result omits everything inside the double or single quotes, which means a loss of information compared to the initial file. Everything inside the quotes should be considered as a string and parsed as such, not omitted.
Or am I missing something?
The text was updated successfully, but these errors were encountered: