Skip to content

Commit

Permalink
fix: improve typing for AlternativeParser
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Oct 1, 2022
1 parent a92acd6 commit 08727c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mecha/parse.py
Expand Up @@ -75,6 +75,7 @@
List,
Literal,
Optional,
Sequence,
Tuple,
Type,
Union,
Expand Down Expand Up @@ -1924,7 +1925,7 @@ def __call__(self, stream: TokenStream) -> Any:
class AlternativeParser:
"""Parser that tries the given alternatives in order."""

parsers: List[Parser]
parsers: Sequence[Parser]

def __call__(self, stream: TokenStream) -> Any:
for parser, alternative in stream.choose(*self.parsers):
Expand Down

0 comments on commit 08727c4

Please sign in to comment.