diff --git a/.travis.yml b/.travis.yml index 002a46f5e..646fef8e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ deploy: api_key: secure: DNq1wbqLPHVpJPDx9O89HZM+RJB6v2R7/wk8pok7Z8NT72kUWdvbqcThGhczPO4sZ8cUTJ3ergTCE8hs9mynlR/lX6932U4fj4+uICQL9+G+deBB/t2SNyTBllkE64WrJ9BKmQvIk/Chh7ZJOM0Fro3p2BIq3JsVnfYg1tZ3U5o= file: - - package/chevrotain-binaries-0.5.0.zip - - package/chevrotain-binaries-0.5.0.tar.gz + - package/chevrotain-binaries-0.5.1.zip + - package/chevrotain-binaries-0.5.1.tar.gz on: tags : true all_branches: true diff --git a/bower.json b/bower.json index 708155bdf..0b5d40766 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "chevrotain", - "version": "0.5.0", + "version": "0.5.1", "description": "Chevrotain is a high performance fault Tolerant Javascript parsing DSL for building recursive decent parsers", "main": "release/chevrotain.js", "dependencies": { diff --git a/package.json b/package.json index 04b634b66..f4d71c1b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chevrotain", - "version": "0.5.0", + "version": "0.5.1", "description": "Chevrotain is a high performance fault Tolerant Javascript parsing DSL for building recursive decent parsers", "keywords": [ "parser", diff --git a/release/chevrotain.d.ts b/release/chevrotain.d.ts index 35f74d81d..5274879ab 100644 --- a/release/chevrotain.d.ts +++ b/release/chevrotain.d.ts @@ -1,4 +1,4 @@ -/*! chevrotain - v0.5.0 - 2015-08-16 */ +/*! chevrotain - v0.5.1 - 2015-08-17 */ declare module chevrotain { module lang { class HashTable{} diff --git a/release/chevrotain.js b/release/chevrotain.js index bdea23769..7c8ff11ce 100644 --- a/release/chevrotain.js +++ b/release/chevrotain.js @@ -15,7 +15,7 @@ } }(this, function (_) { -/*! chevrotain - v0.5.0 - 2015-08-16 */ +/*! chevrotain - v0.5.1 - 2015-08-17 */ var chevrotain; (function (chevrotain) { var lang; @@ -1050,6 +1050,9 @@ var chevrotain; var rest; (function (rest) { var g = chevrotain.gast; + /** + * A Grammar Walker that computes the "remaining" grammar "after" a productions in the grammar. + */ var RestWalker = (function () { function RestWalker() { } @@ -1108,7 +1111,7 @@ var chevrotain; this.walk(atLeastOneProd, fullAtLeastOneRest); }; RestWalker.prototype.walkAtLeastOneSep = function (atLeastOneSepProd, currRest, prevRest) { - // ABC(DE)+F => after the (DE)+ the rest is (DE)?F + // ABC DE(,DE)* F => after the (,DE)+ the rest is (,DE)?F var fullAtLeastOneSepRest = restForRepetitionWithSeparator(atLeastOneSepProd, currRest, prevRest); this.walk(atLeastOneSepProd, fullAtLeastOneSepRest); }; @@ -1118,7 +1121,7 @@ var chevrotain; this.walk(manyProd, fullManyRest); }; RestWalker.prototype.walkManySep = function (manySepProd, currRest, prevRest) { - // ABC(DE)*F => after the (DE)* the rest is (DE)?F + // ABC (DE(,DE)*)? F => after the (,DE)* the rest is (,DE)?F var fullManySepRest = restForRepetitionWithSeparator(manySepProd, currRest, prevRest); this.walk(manySepProd, fullManySepRest); }; @@ -1139,8 +1142,7 @@ var chevrotain; })(); rest.RestWalker = RestWalker; function restForRepetitionWithSeparator(repSepProd, currRest, prevRest) { - var sepRestSuffix = [new g.Option([new g.Terminal(repSepProd.separator)].concat(repSepProd.definition))]; - var repSepRest = [new g.Option(repSepProd.definition.concat(sepRestSuffix))]; + var repSepRest = [new g.Option([new g.Terminal(repSepProd.separator)].concat(repSepProd.definition))]; var fullRepSepRest = repSepRest.concat(currRest, prevRest); return fullRepSepRest; } @@ -3250,10 +3252,10 @@ var chevrotain; action = firstIterationLookAheadFunc; firstIterationLookAheadFunc = this.getLookaheadFuncForAtLeastOneSep(prodOccurrence); } - var separatorLookAheadFunc = function () { return _this.NEXT_TOKEN() instanceof separator; }; // 1st iteration if (firstIterationLookAheadFunc.call(this)) { action.call(this); + var separatorLookAheadFunc = function () { return _this.NEXT_TOKEN() instanceof separator; }; // 2nd..nth iterations while (separatorLookAheadFunc()) { // note that this CONSUME will never enter recovery because @@ -3286,10 +3288,10 @@ var chevrotain; action = firstIterationLookAheadFunc; firstIterationLookAheadFunc = this.getLookaheadFuncForManySep(prodOccurrence); } - var separatorLookAheadFunc = function () { return _this.NEXT_TOKEN() instanceof separator; }; // 1st iteration if (firstIterationLookAheadFunc.call(this)) { action.call(this); + var separatorLookAheadFunc = function () { return _this.NEXT_TOKEN() instanceof separator; }; // 2nd..nth iterations while (separatorLookAheadFunc()) { // note that this CONSUME will never enter recovery because @@ -3476,7 +3478,7 @@ var API = {}; /* istanbul ignore next */ if (!testMode) { // semantic version - API.VERSION = "0.5.0"; + API.VERSION = "0.5.1"; // runtime API API.Parser = chevrotain.Parser; API.Lexer = chevrotain.Lexer; diff --git a/src/api.ts b/src/api.ts index b299845e8..4f41e5c5d 100644 --- a/src/api.ts +++ b/src/api.ts @@ -12,7 +12,7 @@ let API:any = {} /* istanbul ignore next */ if (!testMode) { // semantic version - API.VERSION = "0.5.0"; + API.VERSION = "0.5.1"; // runtime API API.Parser = chevrotain.Parser