|
|
|
@ -909,7 +909,8 @@ module.exports = function(ast, options) {
|
|
|
|
|
' peg$maxFailExpected.push(expected);',
|
|
|
|
|
' }',
|
|
|
|
|
'',
|
|
|
|
|
' function peg$cleanupExpected(expected) {',
|
|
|
|
|
' function peg$buildException() {',
|
|
|
|
|
' function cleanupExpected(expected) {',
|
|
|
|
|
' var i = 1;',
|
|
|
|
|
'',
|
|
|
|
|
' expected.sort(function(a, b) {',
|
|
|
|
@ -930,6 +931,21 @@ module.exports = function(ast, options) {
|
|
|
|
|
' }',
|
|
|
|
|
' }',
|
|
|
|
|
' }',
|
|
|
|
|
'',
|
|
|
|
|
' var pos = Math.max(peg$currPos, peg$maxFailPos),',
|
|
|
|
|
' posDetails = peg$computePosDetails(pos),',
|
|
|
|
|
' found = pos < input.length ? input.charAt(pos) : null;',
|
|
|
|
|
'',
|
|
|
|
|
' cleanupExpected(peg$maxFailExpected);',
|
|
|
|
|
'',
|
|
|
|
|
' return new SyntaxError(',
|
|
|
|
|
' peg$maxFailExpected,',
|
|
|
|
|
' found,',
|
|
|
|
|
' pos,',
|
|
|
|
|
' posDetails.line,',
|
|
|
|
|
' posDetails.column',
|
|
|
|
|
' );',
|
|
|
|
|
' }',
|
|
|
|
|
''
|
|
|
|
|
].join('\n'));
|
|
|
|
|
|
|
|
|
@ -959,16 +975,7 @@ module.exports = function(ast, options) {
|
|
|
|
|
' if (peg$result !== peg$FAILED && peg$currPos === input.length) {',
|
|
|
|
|
' return peg$result;',
|
|
|
|
|
' } else {',
|
|
|
|
|
' peg$cleanupExpected(peg$maxFailExpected);',
|
|
|
|
|
' peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos);',
|
|
|
|
|
'',
|
|
|
|
|
' throw new SyntaxError(',
|
|
|
|
|
' peg$maxFailExpected,',
|
|
|
|
|
' peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null,',
|
|
|
|
|
' peg$reportedPos,',
|
|
|
|
|
' peg$computePosDetails(peg$reportedPos).line,',
|
|
|
|
|
' peg$computePosDetails(peg$reportedPos).column',
|
|
|
|
|
' );',
|
|
|
|
|
' throw peg$buildException();',
|
|
|
|
|
' }',
|
|
|
|
|
' }',
|
|
|
|
|
'',
|
|
|
|
|