Add new error about empty expressions.

master
Salvo 'LtWorf' Tomaselli 2020-06-18 16:59:58 +07:00
parent 7cb6d4941f
commit e5f7b1745c
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF
1 changed files with 2 additions and 0 deletions

@ -273,6 +273,8 @@ class Unary(Node):
def parse_tokens(expression: List[Union[list, str]]) -> Node:
'''Generates the tree from the tokenized expression
If no expression is specified then it will create an empty node'''
if len(expression) == 0:
raise ParserException('Failed to parse empty expression')
# If the list contains only a list, it will consider the lower level list.
# This will allow things like ((((((a))))) to work