Feat: Allow pure string rendering
This commit is contained in:
parent
0c3c20262e
commit
9f492378c8
@ -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