File tree Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -990,13 +990,16 @@ named!(string -> (), alt!(
990
990
)
991
991
) ) ;
992
992
993
- named ! ( quoted_string -> ( ) , do_parse!(
994
- punct!( "\" " ) >>
995
- cooked_string >>
996
- tag!( "\" " ) >>
997
- option!( symbol_not_raw) >>
998
- ( ( ) )
999
- ) ) ;
993
+ fn quoted_string ( input : Cursor ) -> PResult < ( ) > {
994
+ 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, ( ) ) ) ,
1001
+ }
1002
+ }
1000
1003
1001
1004
fn cooked_string ( input : Cursor ) -> PResult < ( ) > {
1002
1005
let mut chars = input. char_indices ( ) . peekable ( ) ;
Original file line number Diff line number Diff line change @@ -251,15 +251,6 @@ macro_rules! call {
251
251
} ;
252
252
}
253
253
254
- macro_rules! option {
255
- ( $i: expr, $f: expr) => {
256
- match $f( $i) {
257
- Ok ( ( i, o) ) => Ok ( ( i, Some ( o) ) ) ,
258
- Err ( LexError ) => Ok ( ( $i, None ) ) ,
259
- }
260
- } ;
261
- }
262
-
263
254
macro_rules! tag {
264
255
( $i: expr, $tag: expr) => {
265
256
if $i. starts_with( $tag) {
You can’t perform that action at this time.
0 commit comments