A code rewrite tool for structural search and replace that supports ~every language.
opam
packagingopam
release candidate.-parany
option to use an alternative parallel library. -parany
is the default parallel library on arm systems/.../
because this may conflict with division syntax-bound-count
flagStop running when at least num matches are found (possibly more are returned for parallel jobs).
avoids writing to file system if a file is unchanged
bug fix: don't parse for comments inside strings
bug fix: don't assume single quotes in Haskell are balanced
adds additional delimiters to interpret code blocks in Julia
adds support for Coq, Zig, Solidity, and Move languages by adding basic definitions
bug fix where strings should have been escaped in -match-only
JSON output
bug fix where carriage returns\r
were not escaped in match output
fresh variable generation via :[id()]
in -sequential
mode increment sequentially
add experimental nested matching via where nested
Breaking change:
:[hole]
will only match across newlines If they are inside delimiters for a language. Otherwise, it will match at most to the end of line, rather than across multiple lines or to the end of file. To disable this behavior and force matching across newlines for any language, add the flag -match-newline-at-toplevel
. There is one exception to this change: The following languages/file extensions are unaffected and will continue to match across newlines outside delimiters:
.tsx
, .jsx
, .html
, .xml
, .tex
, .txt
This is because tags like <p>...</p>
are not yet considered proper delimiters, and other textual inputs do not typically contain delimiters.Additions:
...
alias can now be used instead of :[_]
in rules. Example:where match :[args] {
| "..., foo, ..." -> true
| "..." -> false
}
:[hole]
: If they are not inside nested delimiters, only match until it's suffix, or end of line (rather than end of file).-cut-off-newline
...
in templates alias to :[_]
:[hole]
: If they are not inside nested delimiters, only match until it's suffix, or end of line (rather than end of file).