File tree Expand file tree Collapse file tree 2 files changed +13
-24
lines changed Expand file tree Collapse file tree 2 files changed +13
-24
lines changed Original file line number Diff line number Diff line change @@ -1040,20 +1040,19 @@ fn cooked_string(input: Cursor) -> PResult<()> {
1040
1040
Err ( LexError )
1041
1041
}
1042
1042
1043
- named ! ( byte_string -> ( ) , alt!(
1044
- do_parse!(
1045
- punct!( "b\" " ) >>
1046
- cooked_byte_string >>
1047
- tag!( "\" " ) >>
1048
- ( ( ) )
1049
- )
1050
- |
1051
- do_parse!(
1052
- punct!( "br" ) >>
1053
- raw_string >>
1054
- ( ( ) )
1055
- )
1056
- ) ) ;
1043
+ fn byte_string ( input : Cursor ) -> PResult < ( ) > {
1044
+ let input = skip_whitespace ( input) ;
1045
+ if let Ok ( input) = input. expect ( "b\" " ) {
1046
+ let ( input, ( ) ) = cooked_byte_string ( input) ?;
1047
+ let input = input. expect ( "\" " ) ?;
1048
+ Ok ( ( input, ( ) ) )
1049
+ } else if let Ok ( input) = input. expect ( "br" ) {
1050
+ let ( input, ( ) ) = raw_string ( input) ?;
1051
+ Ok ( ( input, ( ) ) )
1052
+ } else {
1053
+ Err ( LexError )
1054
+ }
1055
+ }
1057
1056
1058
1057
fn cooked_byte_string ( mut input : Cursor ) -> PResult < ( ) > {
1059
1058
let mut bytes = input. bytes ( ) . enumerate ( ) ;
Original file line number Diff line number Diff line change @@ -251,16 +251,6 @@ macro_rules! call {
251
251
} ;
252
252
}
253
253
254
- macro_rules! tag {
255
- ( $i: expr, $tag: expr) => {
256
- if $i. starts_with( $tag) {
257
- Ok ( ( $i. advance( $tag. len( ) ) , ( ) ) )
258
- } else {
259
- Err ( LexError )
260
- }
261
- } ;
262
- }
263
-
264
254
macro_rules! punct {
265
255
( $i: expr, $punct: expr) => {
266
256
$crate:: strnom:: punct( $i, $punct)
You can’t perform that action at this time.
0 commit comments