@@ -59,7 +59,7 @@ def _match(command: str, pbfn: Callable[..., ...], comp: bool):
59
59
if command == self .pattern :
60
60
return command , None
61
61
if comp and command .startswith (self .pattern ):
62
- pbfn (command [len (self .pattern ) :], replace = True )
62
+ pbfn (command [len (self .pattern ):], replace = True )
63
63
return self .pattern , None
64
64
return None , None
65
65
@@ -70,7 +70,7 @@ def _match(command: str, pbfn: Callable[..., ...], comp: bool):
70
70
if mat := self .pattern .fullmatch (command ):
71
71
return command , mat
72
72
if comp and (mat := self .pattern .match (command )):
73
- pbfn (command [len (mat [0 ]) :], replace = True )
73
+ pbfn (command [len (mat [0 ]):], replace = True )
74
74
return mat [0 ], mat
75
75
return None , None
76
76
@@ -150,15 +150,15 @@ def match0(self, pf: Any, cmd: Any, p_str: bool, c_str: bool, pbfn: Callable[...
150
150
return (pf , cmd ), (pf , val .value ), True , None
151
151
if comp and (val := self .comp_pattern .exec (cmd , Empty )).success :
152
152
if c_str :
153
- pbfn (cmd [len (str (val .value )) :], replace = True )
153
+ pbfn (cmd [len (str (val .value )):], replace = True )
154
154
return (pf , cmd ), (pf , cmd [: len (str (val .value ))]), True , None
155
155
return
156
156
if (val := self .patterns .exec (pf , Empty )).success :
157
157
if (val2 := self .command .exec (cmd , Empty )).success :
158
158
return (pf , cmd ), (val .value , val2 .value ), True , None
159
159
if comp and (val2 := self .comp_pattern .exec (cmd , Empty )).success :
160
160
if c_str :
161
- pbfn (cmd [len (str (val2 .value )) :], replace = True )
161
+ pbfn (cmd [len (str (val2 .value )):], replace = True )
162
162
return (pf , cmd ), (val .value , cmd [: len (str (val2 .value ))]), True , None
163
163
return
164
164
@@ -168,7 +168,7 @@ def match1(self, pf: Any, cmd: Any, p_str: bool, c_str: bool, pbfn: Callable[...
168
168
if (val := self .patterns .exec (pf , Empty )).success and (mat := self .command .fullmatch (cmd )):
169
169
return (pf , cmd ), (val .value , cmd ), True , mat .groupdict ()
170
170
if comp and (mat := self .comp_pattern .match (cmd )):
171
- pbfn (cmd [len (mat [0 ]) :], replace = True )
171
+ pbfn (cmd [len (mat [0 ]):], replace = True )
172
172
return (pf , cmd ), (pf , mat [0 ]), True , mat .groupdict ()
173
173
174
174
def match (self , pf : Any , cmd : Any , p_str : bool , c_str : bool , pbfn : Callable [..., ...], comp : bool ):
@@ -184,21 +184,21 @@ def match(self, pf: Any, cmd: Any, p_str: bool, c_str: bool, pbfn: Callable[...,
184
184
return pf , pf , True , mat .groupdict ()
185
185
if comp and (mat := self .comp_pattern .match (pf )):
186
186
pbfn (cmd )
187
- pbfn (pf [len (mat [0 ]) :], replace = True )
187
+ pbfn (pf [len (mat [0 ]):], replace = True )
188
188
return mat [0 ], mat [0 ], True , mat .groupdict ()
189
189
if not c_str :
190
190
return
191
191
if mat := self .prefix .fullmatch ((name := pf + cmd )):
192
192
return name , name , True , mat .groupdict ()
193
193
if comp and (mat := self .comp_pattern .match (name )):
194
- pbfn (name [len (mat [0 ]) :], replace = True )
194
+ pbfn (name [len (mat [0 ]):], replace = True )
195
195
return mat [0 ], mat [0 ], True , mat .groupdict ()
196
196
return
197
197
if (val := self .patterns .exec (pf , Empty )).success :
198
198
if mat := self .command .fullmatch (cmd ):
199
199
return (pf , cmd ), (val .value , cmd ), True , mat .groupdict ()
200
200
if comp and (mat := self .command .match (cmd )):
201
- pbfn (cmd [len (mat [0 ]) :], replace = True )
201
+ pbfn (cmd [len (mat [0 ]):], replace = True )
202
202
return (pf , cmd ), (val .value , mat [0 ]), True , mat .groupdict ()
203
203
204
204
0 commit comments