Metal 5.0.0
Most important changes:
- A new type of
Token
has been added:Tie
, which is short for Token-in-(Value)Expression. It allows aToken
to use the output value of aValueExpression
as input for anotherToken
. Simply put, this allows nested parsing. - Since
Tie
makes it possible to parse other data than the directly underlying inputstream, the mechanism to relate aParseValue
back to its underlying data has been redesigned. EachParseValue
now has aSlice
of aSource
, which refers to someValueExpression
, the underlyingByteStream
or to some constant value. - Another new type of
Token
has been added:TokenRef
, which allows referencing by name of a previously parsedToken
. This allows constructing recursive tokens such as a linked list without having to rely on workarounds such as anonymous classes to put the structure together. - The
Str
Token
has been removed! Instead we have a scheme to dynamically attachCallback
instances by adding them to theEnvironment
. - There is now an
Nth
ValueExpression
that allows indexing of a result of some otherValueExpression
.
Additionally, several bugs have been fixed, code coverage has increased again (100% now!), documentation has been written and more tests have been added (including automated mutation testing). For a full overview of the changes, please have a look at the accompanying milestone: https://github.com/parsingdata/metal/milestone/3?closed=1.
Finally, note that the parent pom has been renamed from metal-parent
to just metal
. To use it, please use the following Maven dependency:
<dependency>
<groupId>io.parsingdata</groupId>
<artifactId>metal</artifactId>
<version>5.0.0</version>
</dependency>