Closed
Description
Bug report
In the following part of pegen, the memoized result is only used if self._should_memoize(node)
is true. Since loop rules are autogenerated, they are not marked with (memo)
, so this is always false. Despite that, in the end the result is memoized based on the different condition if node.name
. Because of that, in the generated parser loop rules' results are always stored in the cache, but never accessed later.
cpython/Tools/peg_generator/pegen/c_generator.py
Lines 608 to 647 in 8de59c1
Your environment
Does not matter - discovered through manual code analysis