Add a hack to skip last comma in |parseFunctions|

redux
David Majda 12 years ago
parent f3970bfa5c
commit 2aaa038499

@ -303,7 +303,7 @@ PEG.compiler.emitter = function(ast, options) {
' parse: function(input, startRule) {', ' parse: function(input, startRule) {',
' var parseFunctions = {', ' var parseFunctions = {',
' #for rule in node.rules', ' #for rule in node.rules',
' #{string(rule.name) + ": parse_" + rule.name},', ' #{string(rule.name) + ": parse_" + rule.name + (rule !== node.rules[node.rules.length - 1] ? "," : "")}',
' #end', ' #end',
' };', ' };',
' ', ' ',

@ -92,7 +92,7 @@ PEG.parser = (function(){
"multiLineComment": parse_multiLineComment, "multiLineComment": parse_multiLineComment,
"eol": parse_eol, "eol": parse_eol,
"eolChar": parse_eolChar, "eolChar": parse_eolChar,
"whitespace": parse_whitespace, "whitespace": parse_whitespace
}; };
if (startRule !== undefined) { if (startRule !== undefined) {

Loading…
Cancel
Save