@@ -69,9 +69,7 @@ impl Tree {
6969 if iterator. next ( ) . is_some_and ( |node| node. start ( ) < position) {
7070 continue ;
7171 }
72- if maybe_args. is_type ( Nonterminal ( arguments) )
73- || maybe_args. is_type ( ErrorNonterminal ( arguments) )
74- {
72+ if maybe_args. is_type_or_error_thereof ( Nonterminal ( arguments) ) {
7573 return Some ( (
7674 scope,
7775 base,
@@ -88,10 +86,7 @@ impl Tree {
8886 }
8987 return Some ( ( scope, base, SignatureArgsIterator :: None ) ) ;
9088 } else {
91- debug_assert ! (
92- maybe_args. is_type( Nonterminal ( comprehension) )
93- || maybe_args. is_type( ErrorNonterminal ( comprehension) )
94- ) ;
89+ debug_assert ! ( maybe_args. is_type_or_error_thereof( Nonterminal ( comprehension) ) ) ;
9590 return Some ( ( scope, base, SignatureArgsIterator :: Comprehension ) ) ;
9691 }
9792 }
@@ -150,7 +145,7 @@ impl<'db> Iterator for SignatureArgsIterator<'db> {
150145 return Some ( SignatureArg :: PositionalOrKeywordName ( n. as_code ( ) ) ) ;
151146 }
152147 }
153- if arg. is_type ( Nonterminal ( kwargs ) ) || arg . is_type ( ErrorNonterminal ( kwargs) ) {
148+ if arg. is_type_or_error_thereof ( Nonterminal ( kwargs) ) {
154149 * args = arg. iter_children ( ) ;
155150 self . next ( )
156151 } else if arg. is_type ( Nonterminal ( kwarg) ) {
@@ -163,13 +158,9 @@ impl<'db> Iterator for SignatureArgsIterator<'db> {
163158 } else {
164159 Some ( SignatureArg :: PositionalOrKeywordName ( name. as_code ( ) ) )
165160 }
166- } else if arg. is_type ( Nonterminal ( starred_expression) )
167- || arg. is_type ( ErrorNonterminal ( starred_expression) )
168- {
161+ } else if arg. is_type_or_error_thereof ( Nonterminal ( starred_expression) ) {
169162 Some ( SignatureArg :: StarArgs )
170- } else if arg. is_type ( Nonterminal ( double_starred_expression) )
171- || arg. is_type ( ErrorNonterminal ( double_starred_expression) )
172- {
163+ } else if arg. is_type_or_error_thereof ( Nonterminal ( double_starred_expression) ) {
173164 Some ( SignatureArg :: StarStarKwargs )
174165 } else {
175166 Some ( SignatureArg :: PositionalOrEmptyAfterComma )
0 commit comments