We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11b4a59 commit 521088eCopy full SHA for 521088e
lib/es6/Lexer.js
@@ -80,10 +80,9 @@ function makeLexer () {
80
? DELIMITED_BODIES[delimiter]
81
: PREFIX_BEFORE_DELIMITER;
82
const match = pattern.exec(text);
83
- if (!match) {
84
- throw new Error(
85
- errorMessage = msg`Failed to lex starting at ${text}`);
86
- }
+ // Match must be defined since all possible values of pattern have
+ // an outer Kleene-* and no postcondition so will fallback to matching
+ // the empty string.
87
let nConsumed = match[0].length;
88
if (text.length > nConsumed) {
89
const chr = text.charAt(nConsumed);
0 commit comments