Tweak impossible pattern error messages
This commit is contained in:
parent
4301110c12
commit
9daec9cb22
10 changed files with 19 additions and 17 deletions
|
|
@ -70,7 +70,7 @@ impl<'a> From<QueryError> for Error {
|
|||
"Query error on line {}. Invalid syntax:\n{}",
|
||||
row, l
|
||||
)),
|
||||
QueryError::Pattern(row, l) => Error::new(format!(
|
||||
QueryError::Structure(row, l) => Error::new(format!(
|
||||
"Query error on line {}. Impossible pattern:\n{}",
|
||||
row, l
|
||||
)),
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ fn test_query_errors_on_impossible_patterns() {
|
|||
js_lang,
|
||||
"(binary_expression left: (identifier) left: (identifier))"
|
||||
),
|
||||
Err(QueryError::Pattern(
|
||||
Err(QueryError::Structure(
|
||||
1,
|
||||
[
|
||||
"(binary_expression left: (identifier) left: (identifier))",
|
||||
|
|
@ -212,7 +212,7 @@ fn test_query_errors_on_impossible_patterns() {
|
|||
.unwrap();
|
||||
assert_eq!(
|
||||
Query::new(js_lang, "(function_declaration name: (statement_block))"),
|
||||
Err(QueryError::Pattern(
|
||||
Err(QueryError::Structure(
|
||||
1,
|
||||
[
|
||||
"(function_declaration name: (statement_block))",
|
||||
|
|
@ -225,7 +225,7 @@ fn test_query_errors_on_impossible_patterns() {
|
|||
Query::new(rb_lang, "(call receiver:(call))").unwrap();
|
||||
assert_eq!(
|
||||
Query::new(rb_lang, "(call receiver:(binary))"),
|
||||
Err(QueryError::Pattern(
|
||||
Err(QueryError::Structure(
|
||||
1,
|
||||
[
|
||||
"(call receiver:(binary))", //
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue