Skip to content

Commit b8729ba

Browse files
committed
focus on flags for now
1 parent 02e1b27 commit b8729ba

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

core/parser/src/lexer/cursor.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ impl<R: ReadChar> Cursor<R> {
179179
} else if let Some(byte) = self.next_char()? {
180180
buf[count] = byte as u8;
181181
count += 1;
182+
} else if count >= buf.len() {
183+
return Err(Error::new(
184+
ErrorKind::UnexpectedEof,
185+
"Unexpected end of buffer while taking characters",
186+
));
182187
} else {
183188
// next_is_pred will return false if the next value is None so the None case should already be handled.
184189
unreachable!();

core/parser/src/parser/expression/assignment/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,6 @@ where
143143
.into());
144144
}
145145
}
146-
TokenKind::RegularExpressionLiteral(body, flags) => {
147-
let node =
148-
RegExpLiteral::new(*body, *flags, cursor.peek(0, interner).or_abrupt()?.span())
149-
.into();
150-
cursor.advance(interner);
151-
return Ok(node);
152-
}
153146
_ => {}
154147
}
155148

0 commit comments

Comments
 (0)