Tweak impossible pattern error messages
This commit is contained in:
parent
4301110c12
commit
9daec9cb22
10 changed files with 19 additions and 17 deletions
|
|
@ -132,7 +132,7 @@ pub const TSQueryError_TSQueryErrorSyntax: TSQueryError = 1;
|
|||
pub const TSQueryError_TSQueryErrorNodeType: TSQueryError = 2;
|
||||
pub const TSQueryError_TSQueryErrorField: TSQueryError = 3;
|
||||
pub const TSQueryError_TSQueryErrorCapture: TSQueryError = 4;
|
||||
pub const TSQueryError_TSQueryErrorPattern: TSQueryError = 5;
|
||||
pub const TSQueryError_TSQueryErrorStructure: TSQueryError = 5;
|
||||
pub type TSQueryError = u32;
|
||||
extern "C" {
|
||||
#[doc = " Create a new parser."]
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ pub enum QueryError {
|
|||
Field(usize, String),
|
||||
Capture(usize, String),
|
||||
Predicate(String),
|
||||
Pattern(usize, String),
|
||||
Structure(usize, String),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -1206,8 +1206,8 @@ impl Query {
|
|||
"Unexpected EOF".to_string()
|
||||
};
|
||||
match error_type {
|
||||
ffi::TSQueryError_TSQueryErrorPattern => {
|
||||
Err(QueryError::Pattern(row, message))
|
||||
ffi::TSQueryError_TSQueryErrorStructure => {
|
||||
Err(QueryError::Structure(row, message))
|
||||
}
|
||||
_ => Err(QueryError::Syntax(row, message)),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue