Feat: Allow pure string rendering
This commit is contained in:
parent
04ac74d17a
commit
1685c73051
@ -196,7 +196,10 @@ def render_with_parenthesis(subtree, operator):
|
||||
subtree_need_parenthesis = True
|
||||
except (AttributeError, KeyError):
|
||||
pass
|
||||
subtree_ = subtree.__tex__
|
||||
try:
|
||||
subtree_ = subtree.__txt__
|
||||
except AttributeError:
|
||||
subtree_ = subtree
|
||||
else:
|
||||
if OPERATORS[subtree.node]["precedence"] < OPERATORS[operator]["precedence"]:
|
||||
subtree_need_parenthesis = True
|
||||
|
@ -200,7 +200,10 @@ def render_with_parenthesis(subtree, operator):
|
||||
subtree_need_parenthesis = True
|
||||
except (AttributeError, KeyError):
|
||||
pass
|
||||
subtree_ = subtree.__txt__
|
||||
try:
|
||||
subtree_ = subtree.__txt__
|
||||
except AttributeError:
|
||||
subtree_ = subtree
|
||||
else:
|
||||
if OPERATORS[subtree.node]["precedence"] < OPERATORS[operator]["precedence"]:
|
||||
subtree_need_parenthesis = True
|
||||
|
Loading…
Reference in New Issue
Block a user