mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
fix(query): correctly identify MISSING nodes in queries
This commit is contained in:
parent
1b916ab754
commit
5fae914f8f
|
|
@ -416,6 +416,16 @@ fn test_query_errors_on_invalid_symbols() {
|
|||
message: "\"fakefield\"".to_string()
|
||||
}
|
||||
);
|
||||
assert_eq!(
|
||||
Query::new(&language, "(MISS)").unwrap_err(),
|
||||
QueryError {
|
||||
row: 0,
|
||||
offset: 1,
|
||||
column: 1,
|
||||
kind: QueryErrorKind::NodeType,
|
||||
message: "\"MISS\"".to_string(),
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2551,7 +2551,7 @@ static TSQueryError ts_query__parse_pattern(
|
|||
// Parse the wildcard symbol
|
||||
if (length == 1 && node_name[0] == '_') {
|
||||
symbol = WILDCARD_SYMBOL;
|
||||
} else if (!strncmp(node_name, "MISSING", length)) {
|
||||
} else if (length == 7 && !strncmp(node_name, "MISSING", length)) {
|
||||
is_missing = true;
|
||||
stream_skip_whitespace(stream);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue