diff --git a/lib/parser/Parser.js b/lib/parser/Parser.js index 48e8579..34437ad 100644 --- a/lib/parser/Parser.js +++ b/lib/parser/Parser.js @@ -21,8 +21,8 @@ var e = require('../Grammar').elements, * expression string thus far can be passed for a more user-friendly * error message. * @param {{}} [stopMap] A mapping of token types to any truthy value. When the - * token type is encountered with a zero balance, the parser will be - * automatically marked complete. + * token type is encountered, the parser will return the mapped value + * instead of boolean false. * @constructor */ function Parser(prefix, stopMap) { @@ -41,7 +41,7 @@ function Parser(prefix, stopMap) { * @throws {Error} if a token is added when the Parser has been marked as * complete by {@link #complete}, or if an unexpected token type is added. * @returns {boolean|*} the stopState value if this parser encountered a token - * in the stopState map with a truthy value; false if tokens can continue. + * in the stopState mapb; false if tokens can continue. */ Parser.prototype.addToken = function(token) { if (this._state == 'complete')