Convert a string into a list of tokens.
(s: str)
| 29 | return read_from_tokens(tokenize(program)) |
| 30 | |
| 31 | def tokenize(s: str) -> list[str]: |
| 32 | "Convert a string into a list of tokens." |
| 33 | return s.replace('(', ' ( ').replace(')', ' ) ').split() |
| 34 | |
| 35 | def read_from_tokens(tokens: list[str]) -> Expression: |
| 36 | "Read an expression from a sequence of tokens." |