|
|
|
@ -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"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|