Skip to content

Commit

Permalink
release 0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahar Soel committed Sep 5, 2015
1 parent f5714da commit 007fcf7
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ deploy:
api_key:
secure: DNq1wbqLPHVpJPDx9O89HZM+RJB6v2R7/wk8pok7Z8NT72kUWdvbqcThGhczPO4sZ8cUTJ3ergTCE8hs9mynlR/lX6932U4fj4+uICQL9+G+deBB/t2SNyTBllkE64WrJ9BKmQvIk/Chh7ZJOM0Fro3p2BIq3JsVnfYg1tZ3U5o=
file:
- package/chevrotain-binaries-0.5.3.zip
- package/chevrotain-binaries-0.5.3.tar.gz
- package/chevrotain-binaries-0.5.4.zip
- package/chevrotain-binaries-0.5.4.tar.gz
on:
tags : true
all_branches: true
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chevrotain",
"version": "0.5.3",
"version": "0.5.4",
"description": "Chevrotain is a high performance fault Tolerant Javascript parsing DSL for building recursive decent parsers",
"main": "release/chevrotain.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chevrotain",
"version": "0.5.3",
"version": "0.5.4",
"description": "Chevrotain is a high performance fault Tolerant Javascript parsing DSL for building recursive decent parsers",
"keywords": [
"parser",
Expand Down
34 changes: 20 additions & 14 deletions release/chevrotain.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! chevrotain - v0.5.3 - 2015-08-28 */
/*! chevrotain - v0.5.4 - 2015-09-05 */
declare module chevrotain {
module lang {
class HashTable<V>{}
Expand Down Expand Up @@ -407,7 +407,7 @@ declare module chevrotain {
* Convenience method equivalent to OR1
* @see OR1
*/
protected OR<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes: string, ignoreAmbiguities?: boolean): T;
protected OR<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes?: string, ignoreAmbiguities?: boolean): T;
/**
* Parsing DSL method that indicates a choice between a set of alternatives must be made.
* This is equivalent to EBNF alternation (A | B | C | D ...)
Expand All @@ -433,31 +433,37 @@ declare module chevrotain {
* As in CONSUME the index in the method name indicates the occurrence
* of the alternation production in it's top rule.
*
* @param {{ALT:Function}[] | {WHEN:Function, THEN_DO:Function}[]} alts An array of alternatives
* @param {string} errMsgTypes A description for the alternatives used in error messages
* @param {{ALT:Function}[] | {WHEN:Function, THEN_DO:Function}[]} alts - An array of alternatives
*
* @param {string} [errMsgTypes] - A description for the alternatives used in error messages
* If none is provided, the error message will include the names of the expected
* Tokens which may start each alternative.
*
* @param {boolean} [ignoreAmbiguities] - if true this will ignore ambiguities caused when two alternatives can not
* be distinguished by a lookahead of one. enabling this means the first alternative
* that matches will be taken. This is sometimes the grammar's intent.
* * only enable this if you know what you are doing!
*
* @returns {*} The result of invoking the chosen alternative
* @param {boolean} [ignoreAmbiguities] if true this will ignore ambiguities caused when two alternatives can not
* be distinguished by a lookahead of one. enabling this means the first alternative
* that matches will be taken. This is sometimes the grammar's intent.
* * only enable this if you know what you are doing!
*/
protected OR1<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes: string, ignoreAmbiguities?: boolean): T;
protected OR1<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes?: string, ignoreAmbiguities?: boolean): T;
/**
* @see OR1
*/
protected OR2<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes: string, ignoreAmbiguities?: boolean): T;
protected OR2<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes?: string, ignoreAmbiguities?: boolean): T;
/**
* @see OR1
*/
protected OR3<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes: string, ignoreAmbiguities?: boolean): T;
protected OR3<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes?: string, ignoreAmbiguities?: boolean): T;
/**
* @see OR1
*/
protected OR4<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes: string, ignoreAmbiguities?: boolean): T;
protected OR4<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes?: string, ignoreAmbiguities?: boolean): T;
/**
* @see OR1
*/
protected OR5<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes: string, ignoreAmbiguities?: boolean): T;
protected OR5<T>(alts: IOrAlt<T>[] | IOrAltImplicit<T>[], errMsgTypes?: string, ignoreAmbiguities?: boolean): T;
/**
* Convenience method equivalent to MANY1
* @see MANY1
Expand Down Expand Up @@ -698,7 +704,7 @@ declare module chevrotain {
private getLookaheadFuncFor<T>(key, occurrence, laFuncBuilder, extraArgs?);
private saveRecogState();
private reloadRecogState(newState);
private raiseNoAltException(errMsgTypes);
private raiseNoAltException(occurrence, errMsgTypes);
}

module exceptions {
Expand Down
40 changes: 27 additions & 13 deletions release/chevrotain.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
}(this, function (_) {

/*! chevrotain - v0.5.3 - 2015-08-28 */
/*! chevrotain - v0.5.4 - 2015-09-05 */
var chevrotain;
(function (chevrotain) {
var lang;
Expand Down Expand Up @@ -2660,13 +2660,19 @@ var chevrotain;
* As in CONSUME the index in the method name indicates the occurrence
* of the alternation production in it's top rule.
*
* @param {{ALT:Function}[] | {WHEN:Function, THEN_DO:Function}[]} alts An array of alternatives
* @param {string} errMsgTypes A description for the alternatives used in error messages
* @param {{ALT:Function}[] | {WHEN:Function, THEN_DO:Function}[]} alts - An array of alternatives
*
* @param {string} [errMsgTypes] - A description for the alternatives used in error messages
* If none is provided, the error message will include the names of the expected
* Tokens which may start each alternative.
*
* @param {boolean} [ignoreAmbiguities] - if true this will ignore ambiguities caused when two alternatives can not
* be distinguished by a lookahead of one. enabling this means the first alternative
* that matches will be taken. This is sometimes the grammar's intent.
* * only enable this if you know what you are doing!
*
* @returns {*} The result of invoking the chosen alternative
* @param {boolean} [ignoreAmbiguities] if true this will ignore ambiguities caused when two alternatives can not
* be distinguished by a lookahead of one. enabling this means the first alternative
* that matches will be taken. This is sometimes the grammar's intent.
* * only enable this if you know what you are doing!
*/
Parser.prototype.OR1 = function (alts, errMsgTypes, ignoreAmbiguities) {
if (ignoreAmbiguities === void 0) { ignoreAmbiguities = false; }
Expand Down Expand Up @@ -3342,15 +3348,15 @@ var chevrotain;
return res;
}
}
this.raiseNoAltException(errMsgTypes);
this.raiseNoAltException(occurrence, errMsgTypes);
}
// else implicit lookahead
var laFunc = this.getLookaheadFuncForOr(occurrence, ignoreAmbiguities);
var altToTake = laFunc.call(this);
if (altToTake !== -1) {
return alts[altToTake].ALT.call(this);
}
this.raiseNoAltException(errMsgTypes);
this.raiseNoAltException(occurrence, errMsgTypes);
};
/**
* @param tokClass The Type of Token we wish to consume (Reference to its constructor function)
Expand Down Expand Up @@ -3470,9 +3476,17 @@ var chevrotain;
this.inputIdx = newState.inputIdx;
this.RULE_STACK = newState.RULE_STACK;
};
Parser.prototype.raiseNoAltException = function (errMsgTypes) {
throw this.SAVE_ERROR(new exceptions.NoViableAltException("expecting: " + errMsgTypes +
" but found '" + this.NEXT_TOKEN().image + "'", this.NEXT_TOKEN()));
Parser.prototype.raiseNoAltException = function (occurrence, errMsgTypes) {
var errSuffix = " but found '" + this.NEXT_TOKEN().image + "'";
if (errMsgTypes === undefined) {
var ruleName = _.last(this.RULE_STACK);
var ruleGrammar = this.getGAstProductions().get(ruleName);
var nextTokens = new interp.NextInsideOrWalker(ruleGrammar, occurrence).startWalking();
var nextTokensFlat = _.flatten(nextTokens);
var nextTokensNames = _.map(nextTokensFlat, function (currTokenClass) { return chevrotain.tokenName(currTokenClass); });
errMsgTypes = "one of: <" + nextTokensNames.join(" ,") + "}>";
}
throw this.SAVE_ERROR(new exceptions.NoViableAltException("expecting: " + errMsgTypes + " " + errSuffix, this.NEXT_TOKEN()));
};
Parser.IGNORE_AMBIGUITIES = true;
Parser.NO_RESYNC = false;
Expand All @@ -3499,7 +3513,7 @@ var API = {};
/* istanbul ignore next */
if (!testMode) {
// semantic version
API.VERSION = "0.5.3";
API.VERSION = "0.5.4";
// runtime API
API.Parser = chevrotain.Parser;
API.Lexer = chevrotain.Lexer;
Expand Down
2 changes: 1 addition & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let API:any = {}
/* istanbul ignore next */
if (!testMode) {
// semantic version
API.VERSION = "0.5.3";
API.VERSION = "0.5.4";

// runtime API
API.Parser = chevrotain.Parser
Expand Down

0 comments on commit 007fcf7

Please sign in to comment.