Open sasidv opened 2 weeks ago
Ah, so one of the rules under piranha/demo/find_replace_custom_cleanup/python/configurations/rules.toml
is a bit convoluted.
try to replace
# Deletes an assignment to an empty list. Example: `a = []`
#
# Note the multiple escapes (`\`) for the regex below
# `\[` (match the `[` character) -> `\\\\[`
# `\s*` (match zero or more empty spaces) -> `\\\\s*`
[[rules]]
name = "delete_empty_list_assignment"
query = """
(
(assignment
left: (_) @i
right: (list) @list
) @assignment
(#match? @list "\\\\[\\\\s*,?\\\\]")
)
"""
replace_node = "@assignment"
replace = ""
is_seed_rule = false
with
[[rules]]
name = "delete_empty_list_assignment"
query = """cs :[variable] = []"""
replace_node = "*"
replace = ""
is_seed_rule = false
Hi Team,
I'm trying to run the
find_replace_custom_cleanup_demos.py
file as the first step in getting started with Polyglot Piranha, but I encountered the following error when executing thepython_demo()
function.However, I also noticed that when I remove the following entry from the
only_lists.py
file, the error disappears. Does anyone have any idea why this might be happening?