chevrotain
Advanced tools
Comparing version 10.0.0 to 10.1.1
@@ -73,2 +73,5 @@ "use strict"; | ||
}; | ||
Recoverable.prototype.canTokenTypeBeDeletedInRecovery = function (tokType) { | ||
return true; | ||
}; | ||
Recoverable.prototype.tryInRepetitionRecovery = function (grammarRule, grammarRuleArgs, lookAheadFunc, expectedTokType) { | ||
@@ -185,2 +188,5 @@ var _this = this; | ||
Recoverable.prototype.canRecoverWithSingleTokenDeletion = function (expectedTokType) { | ||
if (!this.canTokenTypeBeDeletedInRecovery(expectedTokType)) { | ||
return false; | ||
} | ||
var isNextTokenWhatIsExpected = this.tokenMatcher(this.LA(2), expectedTokType); | ||
@@ -200,5 +206,8 @@ return isNextTokenWhatIsExpected; | ||
while (true) { | ||
var nextTokenType = nextToken.tokenType; | ||
if ((0, includes_1.default)(allPossibleReSyncTokTypes, nextTokenType)) { | ||
return nextTokenType; | ||
var foundMatch = (0, find_1.default)(allPossibleReSyncTokTypes, function (resyncTokType) { | ||
var canMatch = (0, tokens_public_1.tokenMatcher)(nextToken, resyncTokType); | ||
return canMatch; | ||
}); | ||
if (foundMatch !== undefined) { | ||
return foundMatch; | ||
} | ||
@@ -205,0 +214,0 @@ nextToken = this.LA(k); |
@@ -7,3 +7,3 @@ "use strict"; | ||
// A separate file avoids cyclic dependencies and webpack errors. | ||
exports.VERSION = "10.0.0"; | ||
exports.VERSION = "10.1.1"; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "chevrotain", | ||
"version": "10.0.0", | ||
"version": "10.1.1", | ||
"description": "Chevrotain is a high performance fault tolerant javascript parsing DSL for building recursive decent parsers", | ||
@@ -74,6 +74,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@chevrotain/cst-dts-gen": "^10.0.0", | ||
"@chevrotain/gast": "^10.0.0", | ||
"@chevrotain/types": "^10.0.0", | ||
"@chevrotain/utils": "^10.0.0", | ||
"@chevrotain/cst-dts-gen": "^10.1.1", | ||
"@chevrotain/gast": "^10.1.1", | ||
"@chevrotain/types": "^10.1.1", | ||
"@chevrotain/utils": "^10.1.1", | ||
"lodash": "4.17.21", | ||
@@ -85,4 +85,4 @@ "regexp-to-ast": "0.5.0" | ||
"@types/sinon-chai": "3.2.8", | ||
"error-stack-parser": "2.0.6", | ||
"esbuild": "0.14.11", | ||
"error-stack-parser": "2.0.7", | ||
"esbuild": "0.14.21", | ||
"gen-esm-wrapper": "1.1.3", | ||
@@ -93,9 +93,9 @@ "gitty": "3.7.2", | ||
"require-from-string": "2.0.2", | ||
"sinon": "12.0.1", | ||
"sinon": "13.0.1", | ||
"sinon-chai": "3.7.0", | ||
"webpack": "5.66.0", | ||
"webpack-cli": "4.9.1", | ||
"webpack": "5.68.0", | ||
"webpack-cli": "4.9.2", | ||
"xregexp": "5.1.0" | ||
}, | ||
"gitHead": "e0ffdd69fa0e344513b305538496d78b72c61562" | ||
"gitHead": "7104f18a4cc2537487086789943e3a200e7b966f" | ||
} |
@@ -1,3 +0,7 @@ | ||
import { createTokenInstance, EOF } from "../../../scan/tokens_public" | ||
import { | ||
createTokenInstance, | ||
EOF, | ||
tokenMatcher | ||
} from "../../../scan/tokens_public" | ||
import { | ||
AbstractNextTerminalAfterProductionWalker, | ||
@@ -81,6 +85,10 @@ IFirstAfterRepetition | ||
public canTokenTypeBeInsertedInRecovery(tokType: TokenType) { | ||
public canTokenTypeBeInsertedInRecovery(tokType: TokenType): boolean { | ||
return true | ||
} | ||
public canTokenTypeBeDeletedInRecovery(tokType: TokenType): boolean { | ||
return true | ||
} | ||
tryInRepetitionRecovery( | ||
@@ -253,2 +261,6 @@ this: MixedInParser, | ||
): boolean { | ||
if (!this.canTokenTypeBeDeletedInRecovery(expectedTokType)) { | ||
return false | ||
} | ||
const isNextTokenWhatIsExpected = this.tokenMatcher( | ||
@@ -276,5 +288,8 @@ this.LA(2), | ||
while (true) { | ||
const nextTokenType: any = nextToken.tokenType | ||
if (includes(allPossibleReSyncTokTypes, nextTokenType)) { | ||
return nextTokenType | ||
const foundMatch = find(allPossibleReSyncTokTypes, (resyncTokType) => { | ||
const canMatch = tokenMatcher(nextToken, resyncTokType) | ||
return canMatch | ||
}) | ||
if (foundMatch !== undefined) { | ||
return foundMatch | ||
} | ||
@@ -281,0 +296,0 @@ nextToken = this.LA(k) |
// needs a separate module as this is required inside chevrotain productive code | ||
// and also in the entry point for webpack(api.ts). | ||
// A separate file avoids cyclic dependencies and webpack errors. | ||
export const VERSION = "10.0.0" | ||
export const VERSION = "10.1.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3316057
46505
Updated@chevrotain/gast@^10.1.1
Updated@chevrotain/types@^10.1.1
Updated@chevrotain/utils@^10.1.1