Open joelburget opened 2 weeks ago
`/* TODO$_ */`
finds different locations from `// TODO$_`
-- both only match that specific type of comment 👎🏻
While we're here I also tried the AST node example from the docs but wasn't able to make it work
By default, Grit treats block comments as different from line comments - since sometimes you want to transform one into the other. We can consider adding an equivalence class, but if you use the AST node it works well.
This should do what you want:
engine marzano(0.1)
language js
string(fragment="str")
I'm unable to replicate your concern with AST nodes:
The docs don't cover matching comments. It seems like there is support and I was able to reverse-engineer a bit of it, but wasn't able to figure out how to match comments with a specific format (e.g.
TODO\((.*)\)
where the capture group is a bug identifier).`// TODO`
matches only comments whose text is exactly "TODO"`// TODO$_`
matches all comments whose prefix is "TODO"`// r"TODO"`
,`// r"TODO.*"`
,`r"// TODO"`
,`r"// TODO.*"`
,`// TODO.*`
, and`// TODO*`
don't match anything