From 1daf1448e51a45bbcc63093a0c4bd2dd75235a33 Mon Sep 17 00:00:00 2001 From: David Majda Date: Mon, 7 Jun 2010 11:43:02 +0200 Subject: [PATCH] Get rid of the |_startRule| property in generated parsers. --- lib/compiler.js | 4 +--- lib/metagrammar.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/compiler.js b/lib/compiler.js index 6b34bb7..0e01445 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -884,8 +884,6 @@ PEG.Compiler = { " /* Generated by PEG.js (http://pegjs.majda.cz/). */", " ", " var result = {", - " _startRule: ${startRule|string},", - " ", /* This needs to be in sync with PEG.StringUtils.quote. */ " _quoteString: function(s) {", " /*", @@ -1016,7 +1014,7 @@ PEG.Compiler = { " reportMatchFailures: true", " };", " ", - " var result = this['_parse_' + this._startRule](initialContext);", + " var result = this._parse_${startRule}(initialContext);", " ", " /*", " * The parser is now in one of the following three states:", diff --git a/lib/metagrammar.js b/lib/metagrammar.js index 79a6a5a..cf1c018 100644 --- a/lib/metagrammar.js +++ b/lib/metagrammar.js @@ -2,8 +2,6 @@ PEG.grammarParser = (function(){ /* Generated by PEG.js (http://pegjs.majda.cz/). */ var result = { - _startRule: "grammar", - _quoteString: function(s) { /* * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a string @@ -3515,7 +3513,7 @@ PEG.grammarParser = (function(){ reportMatchFailures: true }; - var result = this['_parse_' + this._startRule](initialContext); + var result = this._parse_grammar(initialContext); /* * The parser is now in one of the following three states: