Skip to content

v1.1.0

Latest
Compare
Choose a tag to compare
@adams85 adams85 released this 22 Jun 16:23
· 7 commits to master since this release

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 enabling ParserOptionsExtensions.RecordParentNodeInUserData.
  • Add a virtual protected Reset method to AstVisitor 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 add From 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 the ParserOptions.OnNode callback (more precisely, to the OnNodeHandler delegate).
  • Add a new property (Node) to the INode interface, which can be used to access the underlying Node instance 3-4x faster than via type casting.