-
-
Notifications
You must be signed in to change notification settings - Fork 183
Open
Labels
Description
Did you check existing issues?
- I have read all the tree-sitter docs if it relates to using the parser
- I have searched the existing issues of tree-sitter-c
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
No response
Describe the bug
This code is accepted by gcc but it has error nodes in tree sitter.
Steps To Reproduce/Bad Parse Tree
- Run tree sitter c on this code.
- See the
ERRORnodes.
Expected Behavior/Parse Tree
The output tree should have no ERROR nodes since the code is valid C.
Repro
int x = 0;
int
main()
{
switch(x)
case 0:
;
switch(x)
case 0:
switch(x) {
case 0:
goto next;
default:
return 1;
}
return 1;
next:
switch(x)
case 1:
return 1;
switch(x) {
{
// x = 1 + 1;
foo:
case 1:
return 1;
}
}
switch(x) {
case 0:
return x;
case 1:
return 1;
default:
return 1;
}
}Reactions are currently unavailable