Skip to content

Commit f8b11d7

Browse files
committed
Further fix pypy
1 parent 160c037 commit f8b11d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

coconut/compiler/util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,12 @@ def cached_parse(
746746
):
747747
"""Version of parse that caches the result when it's a pure ComputationNode."""
748748
if not CPYPARSING: # caching is only supported on cPyparsing
749-
return (parse_where if scan_string else parse)(grammar, text, inner)
749+
if scan_string:
750+
for tokens, start, stop in all_matches(grammar, text, inner, eval_parse_tree=False):
751+
return tokens, start, stop
752+
return None, None, None
753+
else:
754+
return parse(grammar, text, inner)
750755

751756
# only iterate over keys, not items, so we don't mark everything as alive
752757
for key in computation_graph_cache:

0 commit comments

Comments
 (0)