Fix(parsing): Remove spaces in string before parsing

This commit is contained in:
Bertrand Benjamin 2018-10-05 10:31:51 +02:00
parent 9e0a703e98
commit 2489eccb74
1 changed files with 2 additions and 2 deletions

View File

@ -661,7 +661,7 @@ def str2(sink, convert_to_mo=True):
| > + | > +
| | > 3 | | > 3
| | > -4 | | > -4
>>> exp = "3-a" >>> exp = "3 - a"
>>> t = str2tree(exp) >>> t = str2tree(exp)
>>> print(t) >>> print(t)
+ +
@ -689,7 +689,7 @@ def str2(sink, convert_to_mo=True):
else: else:
str2_corout = lookforNumbers(operator_corout(missing_times(pparser(sink)))) str2_corout = lookforNumbers(operator_corout(missing_times(pparser(sink))))
for i in expression: for i in expression.replace(" ",""):
str2_corout.send(i) str2_corout.send(i)
a = str2_corout.throw(STOOOP) a = str2_corout.throw(STOOOP)