Skip to content

Commit 1585b30

Browse files
committed
use boxes_to_text for OutputSizeLimit
1 parent 2df748e commit 1585b30

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

mathics/core/expression.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,6 +2409,7 @@ def make(self, items, form, segment=None):
24092409
delay_break = 0
24102410

24112411
depth = state.depth
2412+
24122413
sum_of_costs = 0
24132414

24142415
for i, (item, push) in enumerate(_interleave(*from_sides)):
@@ -2465,11 +2466,11 @@ def _evaluate(self, item, form, **kwargs):
24652466

24662467
box = Expression('MakeBoxes', item, form).evaluate(self._evaluation)
24672468

2468-
# estimate the cost of the output related to box. always calling boxes_to_xml here is
2469+
# estimate the cost of the output related to box. always calling boxes_to_text here is
24692470
# the simple solution; the problem is that it's redundant, as for {{{a}, b}, c}, we'd
2470-
# call boxes_to_xml first on {a}, then on {{a}, b}, then on {{{a}, b}, c}. a good fix
2471+
# call boxes_to_text first on {a}, then on {{a}, b}, then on {{{a}, b}, c}. a good fix
24712472
# is not simple though, so let's keep it this way for now.
2472-
cost = len(box.boxes_to_xml(evaluation=self._evaluation)) # evaluate len as XML
2473+
cost = len(box.boxes_to_text(evaluation=self._evaluation))
24732474

24742475
return box, cost
24752476
finally:

0 commit comments

Comments
 (0)