Repository navigation
v3.0.0 - Token combinators and performance improvements
Performance was improved by a 25% at least.
Also, added token combinators that allows you to calculate value immediately, without AST:
builder.CreateToken("string")
// 'Between' token pattern matches a sequence of three elements,
// but calculates and propogates intermediate value of second element
.Between(
b => b.Literal('"'),
b => b.TextUntil('"'),
b => b.Literal('"'));
builder.CreateToken("boolean")
// 'Map' token pattern applies intermediate value transformer to child's value
.Map<string>(b => b.LiteralChoice("true", "false"), m => m == "true");
builder.CreateToken("null")
// 'Return' does not calculates value for child element, just returns 'null' here
.Return(b => b.Literal("null"), null);
// And more...