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
When parsing a badly-written code, I'd expect treesitter to have an error. For example:
public class cl1 {
yields a "MISSING" error at the end:
program [0, 0] - [4, 0] class_declaration [0, 0] - [1, 1] modifiers [0, 0] - [0, 6] name: identifier [0, 13] - [0, 16] body: class_body [1, 0] - [1, 1] MISSING } [1, 1] - [1, 1]
Which makes sense.
BUT, if we mistakenly write something wrong there - I mistakenly closed the class with the wrong parentheses, ")" instead of "}" -
public class cl1 { )
The class_declaration disappears and is replaced by "ERROR":
program [0, 0] - [3, 0] ERROR [0, 0] - [2, 1] modifiers [0, 0] - [0, 6] identifier [0, 13] - [0, 16]
Although the modifiers and identifiers are still there, so the system "knows" it's a class, just fails to communicate it.
The same happens in many other incomplete class structure, such as:
public class cl1 { a = 3
But when adding a semi-colon, the class_declaration appears back.
I would expect to have the ERROR (or MISSING) in the bottom of the tree, and keep the class_declaration above, even possibly also have body.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem description
When parsing a badly-written code, I'd expect treesitter to have an error.
For example:
yields a "MISSING" error at the end:
Which makes sense.
BUT, if we mistakenly write something wrong there - I mistakenly closed the class with the wrong parentheses, ")" instead of "}" -
The class_declaration disappears and is replaced by "ERROR":
Although the modifiers and identifiers are still there, so the system "knows" it's a class, just fails to communicate it.
The same happens in many other incomplete class structure, such as:
But when adding a semi-colon, the class_declaration appears back.
I would expect to have the ERROR (or MISSING) in the bottom of the tree, and keep the class_declaration above, even possibly also have body.
The text was updated successfully, but these errors were encountered: