Parse the multi-line encoding produced by Lean's ``encodeTacticResult``.
(cls, encoded: str, kernel: Kernel, raw_state: Any)
| 54 | |
| 55 | @classmethod |
| 56 | def parse(cls, encoded: str, kernel: Kernel, raw_state: Any) -> TacticResult: |
| 57 | """Parse the multi-line encoding produced by Lean's |
| 58 | ``encodeTacticResult``.""" |
| 59 | if not encoded: |
| 60 | return cls("failure", [], None) |
| 61 | lines = encoded.split("\n") |
| 62 | status = lines[0] |
| 63 | messages = lines[1:] if len(lines) > 1 else [] |
| 64 | state = None |
| 65 | if status == "success" and raw_state is not None: |
| 66 | state = GoalState(kernel, raw_state) |
| 67 | return cls(status, messages, state) |
| 68 | |
| 69 | |
| 70 | class GoalState: |
no test coverage detected