Feat: force subtree to be str and tex instead of txt in tree2tex
This commit is contained in:
parent
d72a2be175
commit
ec823c85eb
@ -197,9 +197,9 @@ def render_with_parenthesis(subtree, operator):
|
||||
except (AttributeError, KeyError):
|
||||
pass
|
||||
try:
|
||||
subtree_ = subtree.__txt__
|
||||
subtree_ = subtree.__tex__
|
||||
except AttributeError:
|
||||
subtree_ = subtree
|
||||
subtree_ = str(subtree)
|
||||
else:
|
||||
if OPERATORS[subtree.node]["precedence"] < OPERATORS[operator]["precedence"]:
|
||||
subtree_need_parenthesis = True
|
||||
|
@ -203,7 +203,7 @@ def render_with_parenthesis(subtree, operator):
|
||||
try:
|
||||
subtree_ = subtree.__txt__
|
||||
except AttributeError:
|
||||
subtree_ = subtree
|
||||
subtree_ = str(subtree)
|
||||
else:
|
||||
if OPERATORS[subtree.node]["precedence"] < OPERATORS[operator]["precedence"]:
|
||||
subtree_need_parenthesis = True
|
||||
|
Loading…
Reference in New Issue
Block a user