- fix: add types to package.json exports
- Thanks to @msujew 👍
- Reduced bundled size of
chevrotain.min.mjs
212Kb --> 137kb - build: move regexp-to-ast package into this mono-repo
- Thanks to @luiz290788 👍
-
chore: add types at package.json exports
- Thanks to @msujew 👍
-
fix: missing call to lookahead initialization for experimental lookahead plugins
- Thanks to @msujew 👍
- feat: support pluggable lookahead strategy
- experimental API subject to potential changes...
- Thanks to @msujew 👍
- Capability to fail fast on first lexer error via ILexerConfig
recoveryEnabled
config- Thanks to @jonestristand 👍
-
Lexer throws uncaught error when longer_alt token is not in mode
- Thanks to @msujew 👍
-
"unreachable code after return statement" warning in Firefox
- Thanks to @medihack 👍
-
TypeScript Signatures: add generics to
getBaseCstVisitorConstructor
functions- Thanks to @jackhenry 👍
-
Various broken links fixes in chevrotain.io/docs website.
Patch release as a workaround for release process issues...
- customizing automatic token deletion recovery by exposing
canRecoverWithSingleTokenDeletion
API- Thanks to @medihack 👍
-
Wrong CST d.ts type generation with same label for different alternatives
- Thanks to @medihack 👍
-
Recovery Re-Sync logic ignores Token Categories
- Thanks to @medihack 👍
- various fixes to broken links in docs
- Thanks to @kevinkhill 👍
- Update the "where used" list
- additional description on token location attributes
- Thanks to @NaridaL 👍
- Generating TypeScript Signatures(d.ts) for CST constructs.
- See relevant documentation
- Thanks to @mbett7 👍
- refactor(utils): replace internal utils with lodash
- This adds a new 3rd party dependency (lodash).
- This was done to reduce the amount of code being maintained, but at the cost of increased bundle size,
for example:
chevrotain.min.js
is now 189kb instead of 156kb.
- Support multiple longer_alt tokens
- Thanks to @msujew 👍
Patch release after migration to new github org with updated metadata in package.json
-
fix: add missing members to parser exception type declarations
- Thanks to @mbett7 :thumbsup
-
fix: update type declaration for CstChildrenDictionary
- Thanks to @raineszm :thumbsup
- feat: remove constraints on rules and token names
- Thanks to @jlguenego :thumbsup
- Add generics to getBaseCSTVisitorConstructor
- Thanks to @ryanleecode :thumbsup
-
Improved Type Signature for 'OR' method
- Thanks to @OmarTawfik :thumbsup
-
Include source maps and original *.ts sources in npm package
-
Literal single token character "ignore case" flag bug.
- Thanks to @janisdd :thumbsup
-
IParserErrorMessageProvider properties must be implemented as own properties.
- Clarify Lexer Limitation: "Complement Sets cannot be automatically optimized" Docs.
- document
recoveredNode
property on CST Nodes.
- Optimize Certain Complex Lexers Initialization Performance
- Lexer Initialization Performance Tracing
- Lexer Initialization: Optionally Skip Validations
- Larger Max numerical suffix/idx for the DSL Methods
- Improve duplicate DSL methods suffix error message
- Improved Lookahead functions and maxLookahead handling
- Parser Initialization Performance Tracing
- Ability to Optionally Skip Grammar Validations in Production
- Cold Start Performance Guide
- Deprecate: "Terminal Token Name Not Found" Error
- Update Performance Guide
- Incorrect Perf Docs
- Several TypeScript API fixes for IToken
and TokenType
- 1
- 2
- Thanks to @HoldYourWaffle :thumbsup
-
Several TypeScript API fixes for CustomPatternMatcherFunc
- 1
- 2
- Thanks to @HoldYourWaffle :thumbsup
- A resolved performance related bug and a couple of new micro optimizations have produced minor performance improvements in the JSON(5%) and CSS(15%) benchmarks.
-
Remove usage of Function.prototype.toString().
- Means no more bundling/minification/transpiling issues! with WebPack/Babel/UglifyJS/other...
- Provides a ~20% performance boost to most parsers initialization time.
- These improved analysis capabilities will also enable multiple new features in future versions.
- Thanks to @EqualMa for inspiration & proof of concept :thumbsup
- Detect missing "performSelfAnalysis" during a parser's input setter.
- Provide an ES6 build.
- Thanks to @EqualMa :thumbsup
- Restructure api.ts to be ESM compatible.
- Thanks to @EqualMa :thumbsup
- Failure Lexing RegExp patterns starting with empty or "fully optional" groups.
- Thanks to @jmrog :thumbsup
-
Updated regexp-to-ast to version 0.4.0.
- This should provide a performance boost to the initialization time of large lexers.
- Thanks to @morwen :thumbsup
-
Fix broken link to docs in lexer disallowed anchors error message.
- Thanks @triplepointfive :thumbsup
- Support Custom Lexer Error Messages Thanks @morwen!
- The Parser's constructor no longer accepts a Token vector as the first argument.
- Runtime infinite loop detection in iterations.
- Small (~5-10%) performance improvements and optimizations.
- Simplify Handling of line terminators in Lexers.
- Ability to de-serialize and serialize the GST instead of rebuilding it using Function.toString.
- Types - fixed groups parameter type in CustomPatternMatcherFunc.
- Types - CustomPatternMatcherFunc return type now allows null value.
- PerformSelfAnalysis can be an instance method..
- Previous Token Information on Parser Runtime Errors..
- Updated regexp-to-ast to 0.3.3.
- Lexer Validations now use regexp-to-ast library when appropriate.
- Detect grammars with none unique names.
- Better error message for: "Terminal Token name not found".
- Updated regexp-to-ast to 0.2.4.
- The CST creation no longer relies on "new Function()" calls and can thus be used in environments with Content Security Policy enabled.
- Removed redundant dependency.
- Support custom user defined declarative APIs
- Parser exceptions will now reference the new docs page.
- Rework token single inheritance into multiple classifications/ categories.
- Tokens properties renaming.
- Custom Error Message argument for CONSUME.
- Improved empty empty alternatives detection.
- previousToken information for EarlyExitException.
- "Type" Property on Tokens "instances" for easier debugging.
- Support both "push_mode" and "pop_mode" on a Token to support transitions.
- Validation to check for too many alternatives.
- Removed "extendToken" and "NEXT*TOKEN" deprecated APIs. Use createToken and LA(1) instead.
Lexer Performance oriented release. 10%+ performance boost measured under V8.
- Lexer Perf boost - .test + lastIndex vs .exec.
- Reduce token vector resizing using a simple heuristic
- Default maxLookahead changed to 4
- Originally the default maxLookahead was 5, This could cause very slow parser initialization under certain edge case during ambiguity detection, however the vast majority of grammars do not require five tokens of lookahead. A smaller default avoids these potential slow downs while still allows overriding in unique cases which require a large lookahead.
- Major performance boost for CST Creation.
- 50% speed boost measured on V8 when CST output is enabled.
- Use RegExp sticky flag for lexer performance boost.
- Up to 30% Lexer performance boost measured.
- Clear error message if rules have been defined after performSelfAnalysis has been called.
- Micro performance boost on subrule array init.
- Fix issue with tokens that both pop and push a mode.
- Avoid infinite loops during validations caused by left recursion.
- More Functional Parsing DSL API.
- This change broke a couple of APIS:
- "OPTION" now returns the value of the inner grammar implementation or undefined otherwise instead of a boolean.
- The "*_SEP" methods now return an object made up of two arrays, separators and values instead of a single array of separators.
- This change broke a couple of APIS:
- Improve formatting of NoViableAlt exception message.
- Less verbose syntax for defining grammar rules.
- Grammar serialization and de-serialization.
- Separate Railroad Diagram Generation into Scriptable Function.
The chevrotain TypeScript definitions file is now only compatible with TypeScript 2.0 and later versions. For older versions of TypeScript use Chevrotain versions <= 0.15.0.
- Performance Improvements: Lookahead functions.
- Performance: SimpleLazyTokens.
- "Smart" Map based lookahead for K = 1 with Token inheritance.
This release is focused on performance improvements, with ~20% boost on V8 and potentially ~100% (double) performance on SpiderMonkey (FireFox 49).
To enjoy the maximum performance boost the new SimpleLazyTokens should be used.
Certain advanced uses cases of dynamically defined Tokens Will break if some of new lookahead optimizations are enabled.
To resolve this a new property dynamicTokensEnabled has been defined on the IParserConfig interface. This configuration property is disabled by default, but can be enabled to support the use case of dynamically defined tokens. See the dynamically defined Tokens example for details.
This Release includes a new performance feature called "Lazy Tokens". These tokens contain less actual state and defer the calculation of their properties until needed. Considering most of the time this information is never needed (full position information) the overall speed boost can be as much as 10-25% (depending on the grammar used).
See "2. Use Lazy Tokens" for more details.
- 0.13.0 Performance Optimizations.
- Performance FAQ section docs.
This release includes major performance optimizations and guidelines. Anywhere from 20% to 100% was measured (on V8) depending on the grammar used. Please read the Performance FAQ section, as much of the performance gain is achieved by changing the way a Chevrotain parser is initialized which will require code changes (not mandatory) in user's code.
- Predicates / Gates using closures to parameters will cause unexpected behavior.
- Diagrams highlights issues under IE Edge.
- Fixes issue with previous release automation.
- Unresolved subrule references can cause none descriptive exceptions during follow up validations.
- More descriptive unresolved grammar error message.
- Minor version release as the previous version included a breaking change in a patch version.
- Fixes issue with previous release automation.
-
Predicates / Gates on productions should be in addition to standard lookahead.
-
Capability to ignore parser definition issues at construction time.
-
IsNextRule method was removed from the Parser class. It's functionality is no longer needed as usage of predicates / gates no longer requires manually (re)implementing the lookahead function.
-
Move all "parse time" grammar validations to the initialization phase (grammar construction).
Some breaking API changes in this version. Most have the changes have been to optional arguments, so not many changes will be needed (if at all) for most users.
-
Use a config object for RULE DSL method.
The RULE method's optional third and fourth parameters have been been replaced with a single configuration object of the type IRuleConfig. Therefore any RULE invocation with more than two arguments must be refactored to the new form. For example:
// old deprecated form this.RULE("createStmt", function(){ /* ... */}, function(){ return 666 }) // new form this.RULE("createStmt", function(){ /* ... */}, {recoveryValueFunc: function(){ return 666 }})
-
Remove RULE_NO_RESYNC DSL method.
The RULE_NO_RESYNC convenience method has been removed. All usages of it must be replaced with an equivalent RULE call using the IRuleConfig resyncEnabled property.
For example:
// old deprecated form this.RULE_NO_RESYNC("createStmt", function () { /* ... */ }); // new form this.RULE( "createStmt", function () { /* ... */ }, { resyncEnabled: false }, );
-
Parser Configuration should be done using a "Config" Object instead of constructor parameters.
-
Error Recovery / Fault Tolerance abilities should be disabled by default.
The Parser constructors's third (optional) parameter has been been replaced with a single configuration object of the type IParserConfig Therefore any Base Parser super invocation which uses the optional parameter must be updated. Additionally The Error recovery functionality is now disabled by default, it can be enabled via the parser's configuration. For example:
// old deprecated form function JsonParser(input) { // The third argument was used to enable/disable error recovery // and was **true** by default. Parser.call(this, input, true); } // new form function JsonParser(input) { // invoke super constructor Parser.call(this, input, allTokens, { // by default the error recovery flag is **false** // use recoveryEnabled flag in the IParserConfig object to enable enable it. recoveryEnabled: true, }); }
- Parsing Errors should include Parser context information.
- AT_LEAST_ONE dsl rule, errMsg param should be optional.
-
Reorganized projected structure to be consistent and use "lib" folder Chevrotain's aggregated artifacts are now located under the lib folder instead of the bin folder in the npm package or the release folder in the bower pacakge.
This means that references to "bower_components/chevrotain/release/..." or "node_modules/chevrotain/bin/..." Will have to be replaced with references to ".../lib/...".
For example - modified diagrams.html
Note that no changes are needed for standard consumption of chevrotain under node.js (require('chevrotain')).
- Human Readable Token Labels in Syntax Diagrams.
- Use Token Labels in error messages.
Older Releases changelog is available on Github Releases.