Releases: comby-tools/comby
1.8.1
1.8.0
-
using the
-tar
option now outputs file paths in results (previouslynull
) -
experimental: using the
-omega
option, whitespace between delimiters will be matched loosely instead of strictly. This gives more flexibility for pattern matching, g.g., a pattern likefoo(bar)
will match any of:foo( bar)
,foo(bar )
or something like
foo(
bar
)
This only applies to whitespace immediately after an opening delimiter, and whitespace immediately preceding a closing delimiter.
1.7.1
Fixes JSON output of -json-lines
which previously emitted double-escaped values like \\n
instead of \n
1.7.0
-
update language definitions (MATLAB, R)
-
recognize Terraform file extension
.tf
for-lang
flag (previously.hcl
). -
additional property accesses
.file
aliased tofile.path
-
fixes behavior so that
-newline-separated
works withrewrite {...}
rules -
custom metasyntax is now recognized for all terms inside rules
-
custom metasyntax aliases are now applied to rules
1.6.0
Utility properties for holes. The following are introduced and recognized in rules and rewrite templates, and are substituted:
- Length. Substitute the length of a hole in rules and rewrite templates
:[hole].length
- String conversions. The following are recognized pattern that will substitute the value of
:[hole]
with the respective string processing in rewrite templates and rules
:[hole].lowercase
:[hole].UPPERCASE
:[hole].Capitalize
:[hole].uncapitalize
:[hole].UpperCamelCase
:[hole].lowerCamelCase
:[hole].UPPER_SNAKE_CASE
:[hole].lower_snake_case
- Filepaths. Substitute the file name, file path, or directory
:[hole].file.path
:[hole].file.name
:[hole].file.directory
- Simpler rule syntax modifications. Less strict parsing and more convenient/readable possibilities for rule syntax.
Expand for full list of changes
- trailing commas for rule expressions are OK:
where :[x] == :[y],
where match :[x] {
| :[y] -> :[z],
},
- optional first
|
for pattern matching:
where match :[x] { :[y] -> :[z] }
- convenience interpretations for
_
:
where match :[x] { _ -> :[z] }
implies
where match :[x] { :[_] -> :[z] }
- convenience interpretation for regex
~
:
where match :[x] { ~match-regex -> :[z] }
implies
where match :[x] { :[~match-regex] -> :[z] }
- Single, double escapable quotes in match and rewrite cases (interprets
\t
,\n
,\r
,\\
escape sequences):
where match :[x] { '"yep"\n' -> :[z] }
- Raw string quotes (no interpreting escape sequences)
where match :[x] { `"yep"\n` -> :[z] }
- Heuristic parsing for patterns in match cases that require neither quotes nor recognized variable:
where match :[x] { foo(:[x]) -> :[x] }
where rewrite :[x] { foo(:[x]) -> :[x] }
Behavior looks for the first ->
, so ->
must be escaped if this should be matched literally. Trailing and leading spaces in pattern matches are ignored--use quotes for significant leading and trailing spaces
-
Added
.hcl
language definition -
The experimental optional hole syntax is removed. Use regular expressions holes with optional modifiers
?
instead.
1.5.1
- Changed
-rg
option to not emit an error when no matches/files are found to process.
1.5.0
-
Support general metasyntax customization. See blog post and docs for more.
-
Fixed an issue where substituting for regex syntax required repeating the pattern in the rewrite template. E.g., if a pattern like
:[x~\w+]
matched, it was necessary to specify:[x~\w+]
in the rewrite template, instead of just:[x]
. Now you can specify just:[x]
. -
It's now possible to define only
match=...
fields if you only want to implement a checker withoutrewrite=...
in config files. This wasn't working correctly before (omittingrewrite
would not work, or multiplematch
patterns would be ignored).
1.4.1
No functional changes. This is just a package split for comby
the app, and comby-kernel
, a minimal OCaml library.
1.4.0
1.3.0
- Exposes Library API through
comby.mli
- Support custom metasyntax definition (internal Library API)