Skip to content

v4.0.0 - Incremental parsing and Walk traces

Choose a tag to compare

@github-actions github-actions released this 22 Sep 22:32
· 108 commits to main since this release
14a05c6

Now you can re-parse the AST using incremental parsing:

var ast = parser.Parse(input);
Console.WriteLine(ast.Version); // Outputs: 0

var changedAst = ast.Reparsed(changedInput);
Console.WriteLine(changedAst.Version); // Outputs: 1
// But children that remain untouched will have the '0' version

And you can enable the walk traces:

builder.Settings
	.RecordWalkTrace();

// Or use the bundle 'UseDebug' method that includes walk trace
builder.Settings
	.UseDebug(maxWalkStepsDisplay: 30);

If you enabled them, they will be displayed in the exceptions, also you can render them manually:

var ast = parser.Parse(input);
var walkTrace = ast.Context.walkTrace;

var rendered = walkTrace.Render(maxCount: 50);
var entireTrace = walkTrace.Render();