query: Fix escape sequence parsing in anonymous node patterns

Fixes #776
Fixes #760
This commit is contained in:
Max Brunsfeld 2020-10-28 13:55:06 -07:00
parent 071f4e40f1
commit c2c63baf5b
3 changed files with 86 additions and 115 deletions

View file

@ -1475,6 +1475,7 @@ fn test_query_matches_with_anonymous_tokens() {
r#"
";" @punctuation
"&&" @operator
"\"" @quote
"#,
)
.unwrap();
@ -1482,9 +1483,11 @@ fn test_query_matches_with_anonymous_tokens() {
assert_query_matches(
language,
&query,
"foo(a && b);",
r#"foo(a && "b");"#,
&[
(1, vec![("operator", "&&")]),
(2, vec![("quote", "\"")]),
(2, vec![("quote", "\"")]),
(0, vec![("punctuation", ";")]),
],
);