feat: add support for signal's object attribute

Closes a half of #26
This commit is contained in:
Gleb Smirnov 2021-12-31 14:20:32 +03:00 committed by liferooter
parent 8ba4742efe
commit bce852020c
2 changed files with 25 additions and 2 deletions

View file

@ -93,11 +93,11 @@ def parse(tokens) -> T.Tuple[ast.UI, T.Optional[MultipleErrors]]:
Op("=>"),
UseIdent("handler").expected("the name of a function to handle the signal"),
OpenParen().expected("argument list"),
Optional(UseIdent("object")).expected("object identifier"),
CloseParen().expected("`)`"),
ZeroOrMore(AnyOf(
Sequence(Keyword("swapped"), UseLiteral("swapped", True)),
Sequence(Keyword("after"), UseLiteral("after", True)),
Sequence(Keyword("object"), UseLiteral("object", True)),
)),
)
)