diff --git a/lib/compiler/passes/generate-javascript.js b/lib/compiler/passes/generate-javascript.js index 0c57d24..7d48bda 100644 --- a/lib/compiler/passes/generate-javascript.js +++ b/lib/compiler/passes/generate-javascript.js @@ -668,7 +668,7 @@ module.exports = function(ast, options) { ' * http://pegjs.majda.cz/', ' */', '', - ' function subclass(child, parent) {', + ' function peg$subclass(child, parent) {', ' function ctor() { this.constructor = child; }', ' ctor.prototype = parent.prototype;', ' child.prototype = new ctor();', @@ -735,7 +735,7 @@ module.exports = function(ast, options) { ' this.message = buildMessage(expected, found);', ' }', '', - ' subclass(SyntaxError, Error);', + ' peg$subclass(SyntaxError, Error);', '', ' function parse(input) {', ' var options = arguments.length > 1 ? arguments[1] : {},', diff --git a/lib/parser.js b/lib/parser.js index d8ad3b5..5e98ee7 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -5,7 +5,7 @@ module.exports = (function() { * http://pegjs.majda.cz/ */ - function subclass(child, parent) { + function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); @@ -62,7 +62,7 @@ module.exports = (function() { this.message = buildMessage(expected, found); } - subclass(SyntaxError, Error); + peg$subclass(SyntaxError, Error); function parse(input) { var options = arguments.length > 1 ? arguments[1] : {},