|
|
|
@ -993,9 +993,6 @@ PEG.Grammar.RuleRef.prototype.compile = function(resultVar) {
|
|
|
|
|
PEG.Grammar.Action.prototype.compile = function(resultVar) {
|
|
|
|
|
var expressionResultVar = PEG.Compiler.generateUniqueIdentifier("result");
|
|
|
|
|
|
|
|
|
|
if (typeof(this._action) === "function") {
|
|
|
|
|
var actionFunction = this._action.toString();
|
|
|
|
|
} else {
|
|
|
|
|
var actionCode = this._action.replace(
|
|
|
|
|
/\$(\d+)/g,
|
|
|
|
|
function(match, digits) {
|
|
|
|
@ -1009,7 +1006,6 @@ PEG.Grammar.Action.prototype.compile = function(resultVar) {
|
|
|
|
|
"function() { ${actionCode} }",
|
|
|
|
|
{ actionCode: actionCode }
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* In case of sequences, we splat their elements into function arguments one
|
|
|
|
|