some more work on parser

This commit is contained in:
Ruediger Ludwig 2022-12-10 07:49:50 +01:00
parent b4c883a0d0
commit 96e86d6a87
3 changed files with 44 additions and 29 deletions

View file

@ -26,9 +26,9 @@ class Move:
frm: int
to: int
amount_parser: ClassVar[P[int]] = P.snd(P.string("move "), P.unsigned())
from_parser: ClassVar[P[int]] = P.snd(P.string(" from "), P.unsigned())
to_parser: ClassVar[P[int]] = P.snd(P.string(" to "), P.unsigned())
amount_parser: ClassVar[P[int]] = P.second(P.string("move "), P.unsigned())
from_parser: ClassVar[P[int]] = P.second(P.string(" from "), P.unsigned())
to_parser: ClassVar[P[int]] = P.second(P.string(" to "), P.unsigned())
move_parser: ClassVar[P[tuple[int, int, int]]] = P.seq(amount_parser, from_parser, to_parser)
@staticmethod