Skip to content

Commit 7334752

Browse files
committed
Parse literal suffix on bytes and chars
1 parent 6b1234b commit 7334752

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/parse.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,8 @@ fn byte(input: Cursor) -> Result<Cursor, LexError> {
462462
if !input.chars().as_str().is_char_boundary(offset) {
463463
return Err(LexError);
464464
}
465-
input.advance(offset).expect("'")
465+
let input = input.advance(offset).expect("'")?;
466+
Ok(literal_suffix(input))
466467
}
467468

468469
fn character(input: Cursor) -> Result<Cursor, LexError> {
@@ -483,7 +484,8 @@ fn character(input: Cursor) -> Result<Cursor, LexError> {
483484
return Err(LexError);
484485
}
485486
let (idx, _) = chars.next().ok_or(LexError)?;
486-
input.advance(idx).expect("'")
487+
let input = input.advance(idx).expect("'")?;
488+
Ok(literal_suffix(input))
487489
}
488490

489491
macro_rules! next_ch {

0 commit comments

Comments
 (0)