|
|
@ -267,7 +267,7 @@ PEG.Grammar.Rule.prototype.compile = function() {
|
|
|
|
" this._cache[${name|string}] = this._cache[${name|string}] || [];",
|
|
|
|
" this._cache[${name|string}] = this._cache[${name|string}] || [];",
|
|
|
|
" var cachedResult = this._cache[${name|string}][this._pos];",
|
|
|
|
" var cachedResult = this._cache[${name|string}][this._pos];",
|
|
|
|
" if (cachedResult !== undefined) {",
|
|
|
|
" if (cachedResult !== undefined) {",
|
|
|
|
" this._pos += cachedResult.length;",
|
|
|
|
" this._pos = cachedResult.nextPos;",
|
|
|
|
" return cachedResult.result;",
|
|
|
|
" return cachedResult.result;",
|
|
|
|
" }",
|
|
|
|
" }",
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
@ -279,7 +279,7 @@ PEG.Grammar.Rule.prototype.compile = function() {
|
|
|
|
" ${reportMatchFailureCode}",
|
|
|
|
" ${reportMatchFailureCode}",
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
" this._cache[${name|string}][pos] = {",
|
|
|
|
" this._cache[${name|string}][pos] = {",
|
|
|
|
" length: this._pos - pos,",
|
|
|
|
" nextPos: this._pos,",
|
|
|
|
" result: ${resultVar}",
|
|
|
|
" result: ${resultVar}",
|
|
|
|
" };",
|
|
|
|
" };",
|
|
|
|
" return ${resultVar};",
|
|
|
|
" return ${resultVar};",
|
|
|
|