Parse a program: read and expand/error-check it.
(inport)
| 29 | ################ parse, read, and user interaction |
| 30 | |
| 31 | def parse(inport): |
| 32 | "Parse a program: read and expand/error-check it." |
| 33 | # Backwards compatibility: given a str, convert it to an InPort |
| 34 | if isinstance(inport, str): inport = InPort(io.StringIO(inport)) |
| 35 | return expand(read(inport), toplevel=True) |
| 36 | |
| 37 | eof_object = Symbol('#<eof-object>') # Note: uninterned; can't be read |
| 38 |