diff --git a/mapytex/calculus/core/str2.py b/mapytex/calculus/core/str2.py index dfefd17..0dce4ba 100644 --- a/mapytex/calculus/core/str2.py +++ b/mapytex/calculus/core/str2.py @@ -15,7 +15,7 @@ from decimal import Decimal, InvalidOperation from .coroutine import * from .operator import is_operator from .MO import moify_cor -from .random.leaf import look_for_rdleaf +from .random.leaf import look_for_rdleaf, RdLeaf __all__ = ["str2"] @@ -395,8 +395,10 @@ def missing_times(target): elif not is_operator(tok) and tok != ")": target_.send("*") - if isinstance(tok, int) or ( - isinstance(tok, str) and not is_operator(tok) and not tok == "(" + if ( + isinstance(tok, int) + or (isinstance(tok, str) and not is_operator(tok) and not tok == "(") + or (isinstance(tok, RdLeaf)) ): previous = tok @@ -819,7 +821,7 @@ def rdstr2(sink): >>> rdstr2list("{a}+{a*b}-2") [, '+', , '+', ] >>> rdstr2list("{a}({b}x+{c})") - [, [, , '+', ]] + [, '*', [, '*', , '+', ]] """ lfop = lookfor(is_operator) operator_corout = partial(concurent_broadcast, lookfors=[lfop])