MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / parse

Function parse

18-with-match/lispy/original/lispy.py:31–35  ·  view source on GitHub ↗

Parse a program: read and expand/error-check it.

(inport)

Source from the content-addressed store, hash-verified

29################ parse, read, and user interaction
30
31def 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
37eof_object = Symbol('#<eof-object>') # Note: uninterned; can't be read
38

Callers 2

replFunction · 0.70
lispy.pyFile · 0.70

Calls 3

InPortClass · 0.85
readFunction · 0.85
expandFunction · 0.70

Tested by

no test coverage detected