diff --git a/src/emitter.js b/src/emitter.js index e174db2..cea7981 100644 --- a/src/emitter.js +++ b/src/emitter.js @@ -303,7 +303,7 @@ PEG.compiler.emitter = function(ast, options) { ' parse: function(input, startRule) {', ' var parseFunctions = {', ' #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', ' };', ' ', diff --git a/src/parser.js b/src/parser.js index c528a45..e60409d 100644 --- a/src/parser.js +++ b/src/parser.js @@ -92,7 +92,7 @@ PEG.parser = (function(){ "multiLineComment": parse_multiLineComment, "eol": parse_eol, "eolChar": parse_eolChar, - "whitespace": parse_whitespace, + "whitespace": parse_whitespace }; if (startRule !== undefined) {