parent
f18c36ca62
commit
5a2534ac4a
2 changed files with 13 additions and 0 deletions
|
|
@ -118,6 +118,18 @@ fn test_query_errors_on_invalid_syntax() {
|
|||
]
|
||||
.join("\n")
|
||||
);
|
||||
|
||||
// tree-sitter/tree-sitter/issues/968
|
||||
assert_eq!(
|
||||
Query::new(get_language("c"), r#"(parameter_list [ ")" @foo)"#)
|
||||
.unwrap_err()
|
||||
.message,
|
||||
[
|
||||
r#"(parameter_list [ ")" @foo)"#,
|
||||
r#" ^"#
|
||||
]
|
||||
.join("\n")
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1541,6 +1541,7 @@ static TSQueryError ts_query__parse_pattern(
|
|||
stream_advance(stream);
|
||||
break;
|
||||
} else if (e) {
|
||||
if (e == PARENT_DONE) e = TSQueryErrorSyntax;
|
||||
array_delete(&branch_step_indices);
|
||||
return e;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue