- Add support for typed multi-expressions wildcards such as
$keyword&
and$number$
(#2) - Rewrite a significant part of the internal code (
grape.impl.*
) to facilitate future evolutions
- Fix
--line-numbers none
grape.core/unparse-code
now accept an optional map of options. Only:inline?
is supported for now; it forces code to fit on one line by removing newlines and comments and compacting whitespaces.
- Fix
--version
that was failing with anIllegalArgumentException
(#1) - The first line of each match is now prefixed by its line number
- Matches are now followed by a newline
- Read from
stdin
if no path is given - Accept
-
as a special path to read fromstdin
. If-
is used multiple times, only the first one is effective. - Add
--line-numbers first|all|none
to control how line numbers are shown - Add
-N
/--no-line-numbers
as an alias to--line-numbers none
- Add
-n
/--all-line-numbers
as an alias to--line-numbers all
- Add
--no-trailing-newlines
to remove the (new) trailing newline after each match - Add
--inline
to always show matches on a single line
- Fix a bug where
$
was matching whitespaces
- Add
grape.core/count-subtrees
andgrape.core/count-codes
- Show matching filenames when
grape
is run on multiple files - Add
-v
/--version
to the command-line - Add
-c
/--count
to show the total matches count - Add
-F
/--no-filenames
to hide the matching filenames - Add
-u
/--unindent
to un-indent the matches - Remove
-r
/--recursive
: it’s always recursive now
- Extract code from
grape.core
intogrape.impl.models
,grape.impl.match
andgrape.impl.parsing
- Add more tests
This release bumps Parsera. It’s now based on Antlr4 rather than Instaparse. This changes a few things:
The match metadata’s format changes:
;; Before
{:start-column 1, :end-column 10
:start-line 1, :end-line 1
:start-index 0, :end-index 9}
;; After
{:start {:row 1 :column 1}
:end {:row 0 :column 9}}
Some typed wildcards change: $simple-keyword
is now $keyword
and $function
is now $fn
.
This release also includes a first GraalVM-based standalone binary. Thanks to both GraalVM and the new Parcera
implementation, grape
is tremendously faster: on my machine, searching for (map $ $ $)
in grape’s own
source code takes ~2s with the v0.2.0 and ~0.06s with the v0.3.0.
- Add typed expression wildcards
Initial release.