Mirror: The magical sticky regex-based parser generator 🧙

Merge EOI error into unexpected token error

+1 -5
+1 -5
src/parser.js
··· 64 64 currentGroup 65 65 ) { 66 66 const nextChar = quasi[quasiIndex++]; 67 - if (!nextChar) { 68 - throw new SyntaxError('Unexpected end of input'); 69 - } 70 - 71 67 if (nextChar === ':') { 72 68 currentGroup.capture = nextChar; 73 69 continue; ··· 87 83 continue; 88 84 } 89 85 90 - throw new SyntaxError('Unexpected token ' + char); 86 + throw new SyntaxError('Unexpected token "' + char + '"'); 91 87 } 92 88 93 89 stackIndex++;