New features:
- Expose variable scope information tracked by the parser to consumers via the
ParserOptions.OnNode
callback.
Improvements:
- Allow consumers to provide an
OnNode
callback even when enablingParserOptionsExtensions.RecordParentNodeInUserData
. - Add a virtual protected
Reset
method toAstVisitor
which can be used by inheritors to reset recursion depth tracking if they want to make the visitor instance reusable even if visitation is interrupted by an exception. - Deprecate
NodeList.Create
and addFrom
instead for consistency. - Increase the max. possible recursion depth of expression parsing by about 10%.
- Minor performance improvements.
FileParsingBenchmark, .NET 8, x64:
Diff | Method | FileName | Mean | Error | Allocated |
---|---|---|---|---|---|
Old | AcornimaParse | bundle | 332.005 ms | 4.1200 ms | 75.53 MB |
New | 330.062 ms (-1%) | 4.6807 ms | 75.52 MB (0%) | ||
Old | AcornimaParse | jquery-1.9.1 | 8.189 ms | 0.0827 ms | 3.19 MB |
New | 8.112 ms (-1%) | 0.0799 ms | 3.19 MB (0%) | ||
Old | AcornimaParse | yui-3.12.0 | 6.411 ms | 0.0080 ms | 2.55 MB |
New | 6.312 ms (-2%) | 0.0152 ms | 2.55 MB (0%) |
Bug fixes:
- Fix null reference issue occurring when converting a standalone
CatchClause
node to JS code.
Breaking changes:
- Add a new parameter (
context
) to theParserOptions.OnNode
callback (more precisely, to theOnNodeHandler
delegate). - Add a new property (
Node
) to theINode
interface, which can be used to access the underlyingNode
instance 3-4x faster than via type casting.