From 8a2e21fa3f0d0649a1641b5452257a37f075d685 Mon Sep 17 00:00:00 2001 From: David Majda Date: Mon, 7 Jun 2010 16:04:21 +0200 Subject: [PATCH] Inlined the |initialContext| variable --- lib/compiler.js | 6 +----- lib/metagrammar.js | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/compiler.js b/lib/compiler.js index 52d860d..1aab955 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -998,11 +998,7 @@ PEG.Compiler = { " return { line: line, column: column };", " }", " ", - " var initialContext = {", - " reportMatchFailures: true", - " };", - " ", - " var result = parse_${startRule}(initialContext);", + " var result = parse_${startRule}({ reportMatchFailures: true });", " ", " /*", " * The parser is now in one of the following three states:", diff --git a/lib/metagrammar.js b/lib/metagrammar.js index e81e0e6..57c586c 100644 --- a/lib/metagrammar.js +++ b/lib/metagrammar.js @@ -3392,11 +3392,7 @@ PEG.grammarParser = (function(){ return { line: line, column: column }; } - var initialContext = { - reportMatchFailures: true - }; - - var result = parse_grammar(initialContext); + var result = parse_grammar({ reportMatchFailures: true }); /* * The parser is now in one of the following three states: