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