Releases: aroemers/crustimoney
Release 2.0.0-rc-3-0x8bb5
Added
- The
results/postwalk
function is now public. It performs a post-walk over the success nodes.
Changed
- The
results/transform
function now throws an Exception when it encounters a success node for which no transformer is specified.
Full Changelog: v2.0.0-rc-1-0x68b1...v2.0.0-rc-3-0x8bb5
Release 2.0.0-rc-1-0x68b1
Changed
- The
quick/parse
now returns a vector-based result, instead of maps. This is more in line with the standard results structure.
Full Changelog: v2.0.0-rc...v2.0.0-rc-1-0x68b1
Release 2.0.0-rc
This concerns a (possibly breaking) refactor, where every grammar (string-based, data-based and the new combinator-based) now return a vector model in "hiccup"-style. The core/parse
function will compile this on the fly (using the vector-grammar), or it can be compiled beforehand using the new core/compile
function.
This allowed us to get rid of the grammar
macro with its intricacies, and opens up the possibility to combine grammars (something that was a bit cumbersome). It has been replaced with a with-scope
macro, that now even supports lexical scoping.
For all the details, see below:
Added:
- A
combinator-grammar
namespace has been added. This contains the same functions as thecombinators
namespace, but all return vector models. This new namespace should be used, instead of thecombinators
directly. - The
combinator-grammar
also has proper definitions forhard-cut
,soft-cut
and their aliases>>
and>
. - The
combinator-grammar
allows references to other rules by simply specifying the keyword. No need to wrap it inref
anymore (though it still exists for completeness sake). - The replacement of the
combinators/grammar
macro is calledwith-scope
. It returns its input map, where theref
s inside it have been bound to the lexically scoped rules. - A
core/compile
function has been added, which is an alias to thecompile
invector-grammar
. - The transformation applied by the
quick/parse
is now in a public function calledquick/transform
.
Changed:
- The
data-grammar/create-parser
andstring-grammar/create-parser
now return a vector model instead of a function. - The
core/parse
function now compiles a vector model on the fly. - Recursive grammars now require a
:root
key. - Combinator implementations now take at least one argument, the parameter map. The rest of the arguments are the child parsers. The combinators in
combinators
andexperimental.combinators
have been adapted. Some combinators now take their arguments in this parameter map, likeliteral
orref
, or the experimentalrange
. - The
data-grammar/vector-tree
from theDataGrammar
protocol has been renamed tovector-model
. - The special result from
quick/parse
has been changed. It now returns a map per node, instead of a vector. - The
vector-model/create-parser
function is now calledcompile
.
Removed:
- The
combinators/grammar
macro was removed. Combining grammars is now done by Clojure'smerge
. - The
experimental.combinators/recover
has been removed. - The
vector-tree
function has been removed fromdata-grammar
andstring-grammar
. Thecreate-parser
functions now return a vector model themselves.
Full Changelog: v2.0.0-beta-198-0xf954...v2.0.0-rc
Release 2.0.0-beta-198-0xf954
What's Changed
- Add
results/transform
function for batteries-included result tree postwalk processing - Add
results/coerce
andresults/collect
macros for use withtransform
Above additions makes that transforming a parse result tree does not have to be reinvented. The addition should be applicable for many use cases, in a succinct manner. The internals of string-grammar
have been rewritten to use transform
, coerce
and collect
, another case of eating its own dog food in this library.
- A comma (
,
) is now considered whitespace in the string-grammar syntax. - The parameter order of
success->text
anderrors->line-column
have been updated; the success node now comes first.
Full Changelog: v2.0.0-beta-195-0xb0fc...v2.0.0-beta-198-0xf954
Release 2.0.0-beta-195-0xb0fc
Added
- Add
quick
namespace for a quick parse
This is for those “I want something better than a regex”-moments.
- Add experimental streaming support
An experimental java.io.Reader
wrapper has been added, that keeps a cut-supporting internal buffer, such that it can perform string and even regex matching. Together with the experimental streaming*
, recover
and with-callback
combinators, this yields a first take on streaming support for this recursive descent parser.
Release 2.0.0-beta-181-0x3b05
Added
- The
grammar
macro can now be nested, where outer-one does the final resolving ofref
s. - The
grammar
macro can now takes multiple maps, merging them.
Above two additions allows one to combine multiple grammar, which can also refer to each other.
- A
built-ins
namespace with predefined parsers has been added. - A map called
all
is available in thebuilt-ins
namespace, containing all the predefined parsers.
Above two additions make a great candidate as one of the arguments to the updated grammar
macro.
Changed
- The
create-parser
functions of the string- and data-grammer no longer take a second argument with extra parsers. This is now done via thegrammar
macro.
Full Changelog: v2.0.0-beta-166-0x62b5...v2.0.0-beta-181-0x3b05
Release 2.0.0-beta-166-0x62b5
Complete rewrite. The old version from 10 years ago served its purpose at the time, but was incomplete and difficult to improve. This version intends to fix that.