try:
(a, (b, stack)) = stack
except ValueError:
- raise StackUnderflowError
+ raise StackUnderflowError('Not enough values on stack.')
if (not isinstance(a, int)
or not isinstance(b, int)
or isinstance(a, bool) # Because bools are ints in Python.
try:
quote, stack = stack
except ValueError:
- raise StackUnderflowError
+ raise StackUnderflowError('Not enough values on stack.')
return stack, concat(quote, expression), dictionary
try:
(quote, (x, stack)) = stack
except ValueError:
- raise StackUnderflowError
+ raise StackUnderflowError('Not enough values on stack.')
expression = (x, expression)
return stack, concat(quote, expression), dictionary
try:
quote, stack = stack
except ValueError:
- raise StackUnderflowError
+ raise StackUnderflowError('Not enough values on stack.')
if not isinstance(quote, tuple):
raise NotAListError('Loop body not a list.')
try:
(flag, stack) = stack
except ValueError:
- raise StackUnderflowError
+ raise StackUnderflowError('Not enough values on stack.')
if flag:
expression = concat(quote, (quote, (S_loop, expression)))
return stack, expression, dictionary
"""
try: s0, stack = stack
- except ValueError: raise StackUnderflowError
- if not isinstance(s0, tuple): raise NotAListError
+ except ValueError: raise StackUnderflowError('Not enough values on stack.')
+ if not isinstance(s0, tuple): raise NotAListError('Not a list.')
try: a1, s23 = stack
- except ValueError: raise StackUnderflowError
+ except ValueError: raise StackUnderflowError('Not enough values on stack.')
return ((a1, s0), s23)