We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given the C code:
#include "foo.h" #include "novel.h" struct Bar {};
The parse tree produced is:
{Node translation_unit (0, 0) - (5, 0)} {Node preproc_include (0, 0) - (1, 0)} {Node #include (0, 0) - (0, 8)} "#include" {Node string_literal (0, 9) - (0, 16)} {Node " (0, 9) - (0, 10)} "\"" {Node " (0, 15) - (0, 16)} "\"" {Node '\n' (0, 16) - (1, 0)} "\n" {Node preproc_include (1, 0) - (4, 0)} {Node #include (1, 0) - (1, 8)} "#include" {Node string_literal (1, 9) - (1, 18)} {Node " (1, 9) - (1, 10)} "\"" {Node " (1, 17) - (1, 18)} "\"" {Node '\n' (1, 18) - (4, 0)} "\n\n\n" {Node struct_specifier (4, 0) - (4, 13)} {Node struct (4, 0) - (4, 6)} "struct" {Node type_identifier (4, 7) - (4, 10)} "Bar" {Node field_declaration_list (4, 11) - (4, 13)} {Node { (4, 11) - (4, 12)} "{" {Node } (4, 12) - (4, 13)} "}" {Node ; (4, 13) - (4, 14)} ";"
Note that the second preproc_include looks like it includes all the trailing newlines.
The text was updated successfully, but these errors were encountered:
Discard '\n' nodes in C and C++
f26ca24
These are from the preprocessor grammar rules, but they're not useful for difftastic. Reported upstream: tree-sitter/tree-sitter-c#97 Closes #180
I agree; it'd be better to not have the trailing newline as part of the node.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Given the C code:
The parse tree produced is:
Note that the second preproc_include looks like it includes all the trailing newlines.
The text was updated successfully, but these errors were encountered: