Permalink
Browse files

Merge pull request #117 from Niggler/master

Added Semicolons
  • Loading branch information...
2 parents 2bf8f93 + 9b75319 commit 992ae7376857dd702d2c1eb4cb8bb8df63407cdf @zaach committed Nov 30, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/jison.js
  2. +2 −2 lib/jison/lexer.js
View
4 lib/jison.js
@@ -921,8 +921,8 @@ lrGeneratorMixin.generateCommonJSModule = function generateCommonJSModule (opt)
+ "\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {"
+ "\nexports.parser = "+moduleName+";"
+ "\nexports.Parser = "+moduleName+".Parser;"
- + "\nexports.parse = function () { return "+moduleName+".parse.apply("+moduleName+", arguments); }"
- + "\nexports.main = "+ String(opt.moduleMain || commonjsMain)
+ + "\nexports.parse = function () { return "+moduleName+".parse.apply("+moduleName+", arguments); };"
+ + "\nexports.main = "+ String(opt.moduleMain || commonjsMain) + ";"
+ "\nif (typeof module !== 'undefined' && require.main === module) {\n"
+ " exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require(\"system\").args);\n}"
+ "\n}"
View
4 lib/jison/lexer.js
@@ -95,7 +95,7 @@ function prepareStartConditions (conditions) {
}
function buildActions (dict, tokens) {
- var actions = [dict.actionInclude || '', "var YYSTATE=YY_START"];
+ var actions = [dict.actionInclude || '', "var YYSTATE=YY_START;"];
var tok;
var toks = {};
@@ -344,7 +344,7 @@ RegExpLexer.prototype = {
out += ";\nlexer.rules = [" + this.rules + "]";
out += ";\nlexer.conditions = " + JSON.stringify(this.conditions);
if (this.moduleInclude) out += ";\n"+this.moduleInclude;
- out += ";\nreturn lexer;})()";
+ out += ";\nreturn lexer;})();";
return out;
},
generateCommonJSModule: function generateCommonJSModule(opt) {

0 comments on commit 992ae73

Please sign in to comment.