Mirror: The magical sticky regex-based parser generator 🧙

Merge EOI error into unexpected token error

Changed files
+1 -5
src
+1 -5
src/parser.js
···
currentGroup
) {
const nextChar = quasi[quasiIndex++];
-
if (!nextChar) {
-
throw new SyntaxError('Unexpected end of input');
-
}
-
if (nextChar === ':') {
currentGroup.capture = nextChar;
continue;
···
continue;
}
-
throw new SyntaxError('Unexpected token ' + char);
+
throw new SyntaxError('Unexpected token "' + char + '"');
}
stackIndex++;