Chevrotain / chevrotain

Parser Building Toolkit for JavaScript
https://chevrotain.io
Apache License 2.0
2.44k stars 200 forks source link

feat: adaptive LL(*) lookahead #1793

Closed msujew closed 1 year ago

msujew commented 2 years ago

Final version (hopefully) of the adaptive lookahead feature. Contains changes to:

Based on the ALL(*) method employed by ANTLR4 (2011 and 2014 papers).

Performance benchmark after all the lookahead changes (parser only):

Library Ops/sec Relative Speed
JSON 9184.94 ± 0,76% 99.06%
CSS 3092.55 ± 0,68% 98.20%
ECMA5 470.71 ± 0,37% 94.82%