diff --git a/Makefile b/Makefile index 4f9f291..fd225e4 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,7 @@ parser: rm -f $(PARSER_OUT_FILE) + echo '/* eslint-env node, amd */' >> $(PARSER_OUT_FILE) echo '/* eslint no-unused-vars: 0 */' >> $(PARSER_OUT_FILE) echo >> $(PARSER_OUT_FILE) cat $(PARSER_OUT_FILE_NEW) >> $(PARSER_OUT_FILE) diff --git a/lib/parser.js b/lib/parser.js index 353a80d..ae56fa3 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -1,6 +1,13 @@ +/* eslint-env node, amd */ /* eslint no-unused-vars: 0 */ -module.exports = (function() { +(function(root, factory) { + if (typeof define === "function" && define.amd) { + define([], factory); + } else if (typeof module === "object" && module.exports) { + module.exports = factory(); + } +})(this, function() { "use strict"; /* @@ -4952,4 +4959,4 @@ module.exports = (function() { SyntaxError: peg$SyntaxError, parse: peg$parse }; -})(); +});