Add exception for invalid expression
This commit is contained in:
parent
027a3ac57a
commit
e3d1870d33
|
@ -40,6 +40,9 @@ class Render(object):
|
||||||
else:
|
else:
|
||||||
operandeStack.push(self.render(token)())
|
operandeStack.push(self.render(token)())
|
||||||
|
|
||||||
|
if len(operandeStack) > 1:
|
||||||
|
raise ValueError("This postfix_tokens is not a valid expression")
|
||||||
|
else:
|
||||||
return operandeStack.pop()
|
return operandeStack.pop()
|
||||||
|
|
||||||
def txt_render(token):
|
def txt_render(token):
|
||||||
|
|
Loading…
Reference in New Issue