diff --git a/bin/pegjs b/bin/pegjs index 8554e84..eb3b170 100755 --- a/bin/pegjs +++ b/bin/pegjs @@ -255,13 +255,13 @@ while (args.length > 0 && isOption(args[0])) { if (Object.keys(options.dependencies).length > 0) { if (options.format !== "amd" && options.format !== "commonjs" && options.format !== "umd") { - abort("Can't use the -d/--dependency option with the \"" + options.format + "\" module format."); + abort("Can't use the -d/--dependency option with the \"" + options.format + "\" module format."); } } if (options.exportVar !== null) { if (options.format !== "globals" && options.format !== "umd") { - abort("Can't use the -e/--export-var option with the \"" + options.format + "\" module format."); + abort("Can't use the -e/--export-var option with the \"" + options.format + "\" module format."); } } diff --git a/lib/compiler/passes/generate-js.js b/lib/compiler/passes/generate-js.js index fe50287..8f82e2a 100644 --- a/lib/compiler/passes/generate-js.js +++ b/lib/compiler/passes/generate-js.js @@ -100,21 +100,21 @@ function generateJS(ast, options) { if (options.trace) { parts.push([ - "", - "if (" + resultCode + " !== peg$FAILED) {", - " peg$tracer.trace({", - " type: \"rule.match\",", - " rule: " + ruleNameCode + ",", - " result: " + resultCode + ",", - " location: peg$computeLocation(startPos, peg$currPos)", - " });", - "} else {", - " peg$tracer.trace({", - " type: \"rule.fail\",", - " rule: " + ruleNameCode + ",", - " location: peg$computeLocation(startPos, startPos)", - " });", - "}" + "", + "if (" + resultCode + " !== peg$FAILED) {", + " peg$tracer.trace({", + " type: \"rule.match\",", + " rule: " + ruleNameCode + ",", + " result: " + resultCode + ",", + " location: peg$computeLocation(startPos, peg$currPos)", + " });", + "} else {", + " peg$tracer.trace({", + " type: \"rule.fail\",", + " rule: " + ruleNameCode + ",", + " location: peg$computeLocation(startPos, startPos)", + " });", + "}" ].join("\n")); }