MCPcopy Index your code
hub / github.com/bpython/bpython / parse_trees

Function parse_trees

bpython/simpleeval.py:222–228  ·  view source on GitHub ↗
(cursor_offset, line)

Source from the content-addressed store, hash-verified

220 attr_before_cursor = temp_line[temp_attribute.start : temp_cursor]
221
222 def parse_trees(cursor_offset, line):
223 for i in range(cursor_offset - 1, -1, -1):
224 try:
225 tree = ast.parse(line[i:cursor_offset])
226 yield tree
227 except SyntaxError:
228 continue
229
230 largest_ast = None
231 for tree in parse_trees(temp_cursor, temp_line):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected