|
|
|
@ -677,7 +677,7 @@ module.exports = function(ast, options) {
|
|
|
|
|
' child.prototype = new ctor();',
|
|
|
|
|
' }',
|
|
|
|
|
'',
|
|
|
|
|
' function SyntaxError(message, expected, found, offset, line, column) {',
|
|
|
|
|
' function peg$SyntaxError(message, expected, found, offset, line, column) {',
|
|
|
|
|
' this.message = message;',
|
|
|
|
|
' this.expected = expected;',
|
|
|
|
|
' this.found = found;',
|
|
|
|
@ -688,9 +688,9 @@ module.exports = function(ast, options) {
|
|
|
|
|
' this.name = "SyntaxError";',
|
|
|
|
|
' }',
|
|
|
|
|
'',
|
|
|
|
|
' peg$subclass(SyntaxError, Error);',
|
|
|
|
|
' peg$subclass(peg$SyntaxError, Error);',
|
|
|
|
|
'',
|
|
|
|
|
' function parse(input) {',
|
|
|
|
|
' function peg$parse(input) {',
|
|
|
|
|
' var options = arguments.length > 1 ? arguments[1] : {},',
|
|
|
|
|
'',
|
|
|
|
|
' peg$FAILED = {},',
|
|
|
|
@ -927,7 +927,7 @@ module.exports = function(ast, options) {
|
|
|
|
|
' cleanupExpected(expected);',
|
|
|
|
|
' }',
|
|
|
|
|
'',
|
|
|
|
|
' return new SyntaxError(',
|
|
|
|
|
' return new peg$SyntaxError(',
|
|
|
|
|
' message !== null ? message : buildMessage(expected, found),',
|
|
|
|
|
' expected,',
|
|
|
|
|
' found,',
|
|
|
|
@ -974,8 +974,8 @@ module.exports = function(ast, options) {
|
|
|
|
|
' }',
|
|
|
|
|
'',
|
|
|
|
|
' return {',
|
|
|
|
|
' SyntaxError: SyntaxError,',
|
|
|
|
|
' parse: parse',
|
|
|
|
|
' SyntaxError: peg$SyntaxError,',
|
|
|
|
|
' parse: peg$parse',
|
|
|
|
|
' };',
|
|
|
|
|
'})()'
|
|
|
|
|
].join('\n'));
|
|
|
|
|