|
|
|
@ -84,7 +84,7 @@ def parse(expr):
|
|
|
|
|
symbol=expr[i:i+2]
|
|
|
|
|
start=i+2
|
|
|
|
|
break
|
|
|
|
|
elif expr[i:i+1] ==")":
|
|
|
|
|
if expr[i:i+1] ==")":
|
|
|
|
|
break #No symbol before
|
|
|
|
|
|
|
|
|
|
parameters=expr[start:endp]
|
|
|
|
@ -137,8 +137,19 @@ def parse_op(expr):
|
|
|
|
|
symbols["ᐅᐊ"]=".join(%s)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for i in symbols:
|
|
|
|
|
expr=expr.replace(i,"_____%s_____"% (i))
|
|
|
|
|
#We want to avoid to parse expressions within quotes.
|
|
|
|
|
#We split the string into an array, and we parse only the ones with even index
|
|
|
|
|
quotes=expr.split('"');
|
|
|
|
|
|
|
|
|
|
for i in range (0,len(quotes),2):
|
|
|
|
|
print "Parsing: ",quotes[i]
|
|
|
|
|
for j in symbols:
|
|
|
|
|
quotes[i]=quotes[i].replace(j,"_____%s_____"% (j))
|
|
|
|
|
print "Becomes: ",quotes[i]
|
|
|
|
|
#The parts outside the quotes was parsed, put the string together again
|
|
|
|
|
|
|
|
|
|
if (len(quotes)>1):
|
|
|
|
|
expr= '"'.join(quotes)
|
|
|
|
|
|
|
|
|
|
tokens=expr.split("_____")
|
|
|
|
|
|
|
|
|
|