File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -726,22 +726,19 @@ fn digits(mut input: Cursor) -> Result<Cursor, LexError> {
726
726
}
727
727
728
728
fn punct ( input : Cursor ) -> PResult < Punct > {
729
- match punct_char ( input) {
730
- Ok ( ( rest, '\'' ) ) => {
731
- if ident_any ( rest) ?. 0 . starts_with ( "'" ) {
732
- Err ( LexError )
733
- } else {
734
- Ok ( ( rest, Punct :: new ( '\'' , Spacing :: Joint ) ) )
735
- }
736
- }
737
- Ok ( ( rest, ch) ) => {
738
- let kind = match punct_char ( rest) {
739
- Ok ( _) => Spacing :: Joint ,
740
- Err ( LexError ) => Spacing :: Alone ,
741
- } ;
742
- Ok ( ( rest, Punct :: new ( ch, kind) ) )
729
+ let ( rest, ch) = punct_char ( input) ?;
730
+ if ch == '\'' {
731
+ if ident_any ( rest) ?. 0 . starts_with ( "'" ) {
732
+ Err ( LexError )
733
+ } else {
734
+ Ok ( ( rest, Punct :: new ( '\'' , Spacing :: Joint ) ) )
743
735
}
744
- Err ( LexError ) => Err ( LexError ) ,
736
+ } else {
737
+ let kind = match punct_char ( rest) {
738
+ Ok ( _) => Spacing :: Joint ,
739
+ Err ( LexError ) => Spacing :: Alone ,
740
+ } ;
741
+ Ok ( ( rest, Punct :: new ( ch, kind) ) )
745
742
}
746
743
}
747
744
You can’t perform that action at this time.
0 commit comments