Skip to content

Commit 0954dcf

Browse files
committed
Rewrite character parser without macros
1 parent a95ecbc commit 0954dcf

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/fallback.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,12 +1158,13 @@ fn cooked_byte(input: Cursor) -> PResult<()> {
11581158
}
11591159
}
11601160

1161-
named!(character -> (), do_parse!(
1162-
punct!("'") >>
1163-
cooked_char >>
1164-
tag!("'") >>
1165-
(())
1166-
));
1161+
fn character(input: Cursor) -> PResult<()> {
1162+
let input = skip_whitespace(input);
1163+
let input = input.expect("'")?;
1164+
let (input, ()) = cooked_char(input)?;
1165+
let input = input.expect("'")?;
1166+
Ok((input, ()))
1167+
}
11671168

11681169
fn cooked_char(input: Cursor) -> PResult<()> {
11691170
let mut chars = input.char_indices();

0 commit comments

Comments
 (0)