File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -510,7 +510,7 @@ def normalize_input(input: NormalizeInput) -> Input:
510510 if isinstance (input , Input ):
511511 return input
512512 try :
513- input = iter (cast (Iterable , input ))
513+ input = iter (cast (Iterable [ Any ] , input ))
514514 except TypeError :
515515 assert not isinstance (input , Iterable ) # Communicate to the type checker that `input` is not iterable
516516 else :
@@ -547,7 +547,7 @@ def source(element: Product | Token) -> str:
547547 """
548548 return element .source if hasattr (element , 'source' ) else '' .join (source (item ) for item in element )
549549
550- def tokens (product : Iterable | Token ) -> Iterator [Token ]:
550+ def tokens (product : Product | Token ) -> Iterator [Token ]:
551551 """
552552 Yield every token contained in a parser production.
553553
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ class TokenProduction(Production):
111111 """Class of productions that express a token, optionally one with a matching set of attributes.
112112 """
113113 type : type [Token ]
114- attributes : Mapping
114+ attributes : Mapping [ str , Any ]
115115 def __init__ (self , type : builtins .type [Token ], ** attributes : Any ):
116116 """
117117 :param type: The type of token this production will express
@@ -145,7 +145,7 @@ def grouping_mode(self, production: Production) -> bool:
145145 case ReferenceProduction () | TokenProduction (): return False
146146 case _:
147147 raise ValueError
148- def combined (self , productions : Iterable , combinator : str ) -> Iterable [str ]:
148+ def combined (self , productions : Iterable [ Production ] , combinator : str ) -> Iterable [str ]:
149149 it = (self .format (production ) for production in productions )
150150 yield from next (it )
151151 for item in it :
You can’t perform that action at this time.
0 commit comments