diff --git a/lib/compiler.js b/lib/compiler.js index 4e31734..fcb7782 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -64,9 +64,9 @@ PEG.Grammar.GrammarError.prototype = Error.prototype; /* ===== PEG.Grammar.* ===== */ -PEG.Grammar.Rule = function(name, humanName, expression) { +PEG.Grammar.Rule = function(name, displayName, expression) { this._name = name; - this._humanName = humanName; + this._displayName = displayName; this._expression = expression; }; @@ -239,7 +239,7 @@ PEG.Compiler = { PEG.Grammar.Rule.prototype.compile = function() { var resultVar = PEG.Compiler.generateUniqueIdentifier("result"); - if (this._humanName !== null) { + if (this._displayName !== null) { var setReportMatchFailuresCode = PEG.Compiler.formatCode( "var savedReportMatchFailures = context.reportMatchFailures;", "context.reportMatchFailures = false;" @@ -249,10 +249,10 @@ PEG.Grammar.Rule.prototype.compile = function() { ); var reportMatchFailureCode = PEG.Compiler.formatCode( "if (context.reportMatchFailures && ${resultVar} === null) {", - " this._matchFailed(new PEG.Parser.NamedRuleMatchFailure(${humanName|string}));", + " this._matchFailed(new PEG.Parser.NamedRuleMatchFailure(${displayName|string}));", "}", { - humanName: this._humanName, + displayName: this._displayName, resultVar: resultVar } ); diff --git a/lib/runtime.js b/lib/runtime.js index 7f76bfd..592d42e 100644 --- a/lib/runtime.js +++ b/lib/runtime.js @@ -218,10 +218,12 @@ PEG.Parser.AnyMatchFailure.prototype = { /* Stores information about a failure to match a named rule. */ -PEG.Parser.NamedRuleMatchFailure = function(humanName) { this._humanName = humanName; } +PEG.Parser.NamedRuleMatchFailure = function(displayName) { + this._displayName = displayName; +} PEG.Parser.NamedRuleMatchFailure.prototype = { - toString: function() { return this._humanName; } + toString: function() { return this._displayName; } }; /* ===== PEG.Parser.SyntaxError ===== */