-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f15778
commit 699252a
Showing
2 changed files
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//! Tree-sitter is an error-tolerant parser. Whenever it stumbles upon a sequence of tokens it is not able to parse into a valid node | ||
//! it creates an ERROR node that encompasses these invalid tokens. This is however the full extent of what it does. | ||
//! By itself it does not provide any concrete means as to **why** exactly it created an ERROR node. | ||
//! This is why these nodes have to be poked around by hand and have useful information extracted from them. | ||
//TODO implement syntax error node inference, use it when checking SyntaxError::Invalid in SyntaxErrorVisitor::check_errors | ||
// Possible solution: flatten the error node into a vector of tokens or leaf node kinds. | ||
// Go over over the elements until you encounter the first truly unexpected token and create a MissingElement or UnexpectedElement diagnostic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
mod syntax_error_visitor; | ||
mod error_inference; | ||
|
||
pub use syntax_error_visitor::*; |