@@ -9,7 +9,7 @@ use winnow::{
99 combinator:: { alt, delimited, opt, preceded, repeat, terminated} ,
1010 stream:: Stream ,
1111 token:: { none_of, one_of} ,
12- PResult , Parser ,
12+ ModalResult , Parser ,
1313} ;
1414
1515use super :: {
@@ -20,7 +20,7 @@ use super::{
2020} ;
2121use crate :: { branchloc:: BranchLocator , wrap:: partial_ref_name} ;
2222
23- pub ( in super :: super ) fn range_revision_spec ( input : & mut & str ) -> PResult < RangeRevisionSpec > {
23+ pub ( in super :: super ) fn range_revision_spec ( input : & mut & str ) -> ModalResult < RangeRevisionSpec > {
2424 alt ( (
2525 ( branch_prefix, patch_range_bounds)
2626 . map ( |( branch_loc, bounds) | RangeRevisionSpec :: BranchRange { branch_loc, bounds } ) ,
@@ -30,7 +30,7 @@ pub(in super::super) fn range_revision_spec(input: &mut &str) -> PResult<RangeRe
3030 . parse_next ( input)
3131}
3232
33- pub ( in super :: super ) fn single_revision_spec ( input : & mut & str ) -> PResult < SingleRevisionSpec > {
33+ pub ( in super :: super ) fn single_revision_spec ( input : & mut & str ) -> ModalResult < SingleRevisionSpec > {
3434 alt ( (
3535 ( branch_prefix, patch_like_spec) . map ( |( branch_loc, patch_like) | {
3636 SingleRevisionSpec :: Branch {
@@ -43,7 +43,7 @@ pub(in super::super) fn single_revision_spec(input: &mut &str) -> PResult<Single
4343 . parse_next ( input)
4444}
4545
46- fn branch_prefix ( input : & mut & str ) -> PResult < BranchLocator > {
46+ fn branch_prefix ( input : & mut & str ) -> ModalResult < BranchLocator > {
4747 terminated ( branch_locator, ':' ) . parse_next ( input)
4848}
4949
@@ -58,7 +58,7 @@ impl std::fmt::Display for PrevCheckoutError {
5858
5959impl std:: error:: Error for PrevCheckoutError { }
6060
61- pub ( crate ) fn branch_locator ( input : & mut & str ) -> PResult < BranchLocator > {
61+ pub ( crate ) fn branch_locator ( input : & mut & str ) -> ModalResult < BranchLocator > {
6262 alt ( (
6363 delimited ( "@{-" , digit1, "}" )
6464 . try_map ( |s : & str | s. parse :: < usize > ( ) )
@@ -77,7 +77,7 @@ pub(crate) fn branch_locator(input: &mut &str) -> PResult<BranchLocator> {
7777 . parse_next ( input)
7878}
7979
80- fn patch_and_or_git_like_spec ( input : & mut & str ) -> PResult < SingleRevisionSpec > {
80+ fn patch_and_or_git_like_spec ( input : & mut & str ) -> ModalResult < SingleRevisionSpec > {
8181 use std:: cmp:: Ordering ;
8282
8383 let start_checkpoint = input. checkpoint ( ) ;
@@ -111,20 +111,20 @@ fn patch_and_or_git_like_spec(input: &mut &str) -> PResult<SingleRevisionSpec> {
111111 }
112112}
113113
114- pub ( in super :: super ) fn patch_like_spec ( input : & mut & str ) -> PResult < PatchLikeSpec > {
114+ pub ( in super :: super ) fn patch_like_spec ( input : & mut & str ) -> ModalResult < PatchLikeSpec > {
115115 ( patch_locator, git_revision_suffix)
116116 . map ( |( patch_loc, suffix) | PatchLikeSpec { patch_loc, suffix } )
117117 . parse_next ( input)
118118}
119119
120- fn git_like_spec ( input : & mut & str ) -> PResult < String > {
120+ fn git_like_spec ( input : & mut & str ) -> ModalResult < String > {
121121 ( partial_ref_name, git_revision_suffix)
122122 . take ( )
123123 . map ( |s| s. to_string ( ) )
124124 . parse_next ( input)
125125}
126126
127- fn git_revision_suffix ( input : & mut & str ) -> PResult < GitRevisionSuffix > {
127+ fn git_revision_suffix ( input : & mut & str ) -> ModalResult < GitRevisionSuffix > {
128128 repeat :: < _ , _ , Vec < & str > , _ , _ > (
129129 0 ..,
130130 alt ( (
@@ -139,23 +139,23 @@ fn git_revision_suffix(input: &mut &str) -> PResult<GitRevisionSuffix> {
139139 . map ( |suffix : & str | GitRevisionSuffix ( suffix. to_string ( ) ) )
140140}
141141
142- fn at_braced < ' s > ( input : & mut & ' s str ) -> PResult < & ' s str > {
142+ fn at_braced < ' s > ( input : & mut & ' s str ) -> ModalResult < & ' s str > {
143143 preceded ( '@' , braced) . parse_next ( input)
144144}
145145
146- fn caret_braced < ' s > ( input : & mut & ' s str ) -> PResult < & ' s str > {
146+ fn caret_braced < ' s > ( input : & mut & ' s str ) -> ModalResult < & ' s str > {
147147 preceded ( '^' , braced) . parse_next ( input)
148148}
149149
150- fn caret_number ( input : & mut & str ) -> PResult < Option < usize > > {
150+ fn caret_number ( input : & mut & str ) -> ModalResult < Option < usize > > {
151151 preceded ( '^' , opt ( unsigned_int) ) . parse_next ( input)
152152}
153153
154- pub ( crate ) fn tilde_number ( input : & mut & str ) -> PResult < Option < usize > > {
154+ pub ( crate ) fn tilde_number ( input : & mut & str ) -> ModalResult < Option < usize > > {
155155 preceded ( '~' , opt ( unsigned_int) ) . parse_next ( input)
156156}
157157
158- fn braced < ' s > ( input : & mut & ' s str ) -> PResult < & ' s str > {
158+ fn braced < ' s > ( input : & mut & ' s str ) -> ModalResult < & ' s str > {
159159 delimited (
160160 '{' ,
161161 take_escaped ( none_of ( [ '\\' , '{' , '}' ] ) , '\\' , one_of ( [ '\\' , '{' , '}' ] ) ) ,
0 commit comments