File tree Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -980,24 +980,19 @@ named!(literal_nocapture -> (), alt!(
980
980
int
981
981
) ) ;
982
982
983
- named ! ( string -> ( ) , alt!(
984
- quoted_string
985
- |
986
- do_parse!(
987
- punct!( "r" ) >>
988
- raw_string >>
989
- ( ( ) )
990
- )
991
- ) ) ;
992
-
993
- fn quoted_string ( input : Cursor ) -> PResult < ( ) > {
983
+ fn string ( input : Cursor ) -> PResult < ( ) > {
994
984
let input = skip_whitespace ( input) ;
995
- let input = input. expect ( "\" " ) ?;
996
- let ( input, ( ) ) = cooked_string ( input) ?;
997
- let input = input. expect ( "\" " ) ?;
998
- match symbol_not_raw ( input) {
999
- Ok ( ( input, _) ) => Ok ( ( input, ( ) ) ) ,
1000
- Err ( LexError ) => Ok ( ( input, ( ) ) ) ,
985
+ if let Ok ( input) = input. expect ( "\" " ) {
986
+ let ( input, ( ) ) = cooked_string ( input) ?;
987
+ let input = input. expect ( "\" " ) ?;
988
+ match symbol_not_raw ( input) {
989
+ Ok ( ( input, _) ) => Ok ( ( input, ( ) ) ) ,
990
+ Err ( LexError ) => Ok ( ( input, ( ) ) ) ,
991
+ }
992
+ } else if let Ok ( input) = input. expect ( "r" ) {
993
+ raw_string ( input)
994
+ } else {
995
+ Err ( LexError )
1001
996
}
1002
997
}
1003
998
You can’t perform that action at this time.
0 commit comments