Skip to content

Commit

Permalink
Merge pull request #57 from leoslf/master
Browse files Browse the repository at this point in the history
fix: typing for `Text.Parsec.Prim` and `Text.Parsec.Char`
  • Loading branch information
sighingnow authored Jun 6, 2024
2 parents 08f0c8d + 48dfe68 commit e451411
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/parsec/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,17 @@ class Parser(T.Generic[_U]):
def skip(self, other: Parser[_V]) -> Parser[_U]: ...
def ends_with(self, other: Parser[_V]) -> Parser[_U]: ...
def excepts(self, ohter: Parser[_V]) -> Parser[_U]: ...
def parsecmap(self, fn: CA.Callable[[_U], _V], star: bool = False) -> Parser[_V]: ...
@T.overload
def parsecmap(self, fn: CA.Callable[..., _V], star: T.Literal[True]) -> Parser[_V]: ...
@T.overload
def parsecmap(self, fn: CA.Callable[[_U], _V], star: T.Literal[False]) -> Parser[_V]: ...
@T.overload
def parsecmap(self, fn, star: bool = False) -> Parser[_V]: ...
@T.overload
def map(self, fn: CA.Callable[..., _V], star: T.Literal[True]) -> Parser[_V]: ...
@T.overload
def map(self, fn: CA.Callable[[_U], _V], star: T.Literal[False]) -> Parser[_V]: ...
@T.overload
def map(self, fn: CA.Callable[[_U], _V], star: bool = False) -> Parser[_V]: ...
def parsecapp(
self: Parser[CA.Callable[[_V], _W]], other: Parser[_V]
Expand Down Expand Up @@ -139,6 +149,9 @@ def digit() -> Parser[str]: ...
def eof() -> Parser[None]: ...
def string(s: _VS) -> Parser[_VS]: ...
def regex(exp: str | re.Pattern, flags: re.RegexFlag = ...) -> Parser[str]: ...
def newline() -> Parser[str]: ...
def crlf() -> Parser[str]: ...
def end_of_line() -> Parser[str]: ...
def success_with(value: _U, advance: bool = False) -> Parser[_U]: ...
def fail_with(message: str) -> Parser: ...
def exclude(p: Parser[_U], exclude: Parser) -> Parser[_U]: ...
Expand Down

0 comments on commit e451411

Please sign in to comment.