-
Notifications
You must be signed in to change notification settings - Fork 208
Description
Hi @danieltrt
I have below rule , which is working fine on tree sitter play ground
[[rules]]
name = "replace_boolean_parse_with_literal"
query = """
(
(if_statement
condition: (
parenthesized_expression
(method_invocation
object: (identifier) @object
name: (identifier) @name
arguments: (argument_list
(true)
)
) @method_invocation
)
) @if_statement
)
(#eq? @object "Boolean")
(#eq? @name "parseBoolean")
"""
replace_node = "parenthesized_expression"
replace = "true"
groups = ["replace_expression_with_boolean_literal"]
but when I am running on piranha
I am getting below error
pyo3_runtime.PanicException: Could not parse the query : "(\n\t(if_statement\n\t condition: (\n\t\tparenthesized_expression\n\t\t(method_invocation\n\t\t object: (identifier) @object\n\t\t name: (identifier) @name\n\t\t arguments: (argument_list\n\t\t\t(true)\n\t\t )\n\t\t) @method_invocation\n\t )\n\t) @if_statement\n)\n(#eq? @object "Boolean")\n(#eq? @name "parseBoolean")\n" Some(QueryError { row: 2, column: 3, offset: 20, message: "\t condition: (\n ^", kind: Structure })
any help on this is well appreciated
Thanks in advance