From 91779bd945bbf6da526e8f70696e10e34f550024 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 30 Oct 2019 10:49:07 +0100 Subject: [PATCH] Feat: Add doctest to rdstr2 --- mapytex/calculus/core/str2.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/mapytex/calculus/core/str2.py b/mapytex/calculus/core/str2.py index a7098d4..dfefd17 100644 --- a/mapytex/calculus/core/str2.py +++ b/mapytex/calculus/core/str2.py @@ -818,31 +818,8 @@ def rdstr2(sink): >>> rdstr2list = rdstr2(list_sink) >>> rdstr2list("{a}+{a*b}-2") [, '+', , '+', ] - """ - lfop = lookfor(is_operator) - operator_corout = partial(concurent_broadcast, lookfors=[lfop]) - - def pipeline(expression): - str2_corout = look_for_rdleaf( - lookforNumbers(operator_corout(missing_times(moify_cor(pparser(sink))))) - ) - - for i in expression.replace(" ", ""): - str2_corout.send(i) - a = str2_corout.throw(STOOOP) - - return a - - return pipeline - - -def rdstr2(sink): - """ Return a pipeline which parse random expression and with sink as endpoint - - :example: - >>> rdstr2list = rdstr2(list_sink) - >>> rdstr2list("{a}+{a*b}-2") - [, '+', , '+', ] + >>> rdstr2list("{a}({b}x+{c})") + [, [, , '+', ]] """ lfop = lookfor(is_operator) operator_corout = partial(concurent_broadcast, lookfors=[lfop])