From 5d086f6a19cccfac2362b1b12da89a3b688a3bd7 Mon Sep 17 00:00:00 2001 From: Pratyush Harsh Date: Sat, 22 Feb 2020 22:45:17 +0530 Subject: [PATCH] Resolvesd PR #231 removed the bug and now we can evaluate pi's value from gui --- visma/io/tokenize.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/visma/io/tokenize.py b/visma/io/tokenize.py index d0a0ac7..2293ba3 100644 --- a/visma/io/tokenize.py +++ b/visma/io/tokenize.py @@ -68,7 +68,7 @@ def getTerms(eqn): terms = [] while x < len(eqn): - if ('a' <= eqn[x] <= 'z') or ('A' <= eqn[x] <= 'Z') or eqn[x] in greek: + if ('a' <= eqn[x] <= 'z') or ('A' <= eqn[x] <= 'Z') or eqn[x] in greek or eqn[x] in constants: buf = eqn[x] if x + 3 < len(eqn): @@ -103,6 +103,10 @@ def getTerms(eqn): terms.append("exp") x += 1 continue + elif eqn[x] ==constants[0]: + terms.append(str(math.pi)) + x += 1 + continue elif eqn[x] == 'i': terms.append("iota") x += 1