From e5f7b1745cf49c38d8e4b8da7707f212e93c6120 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Thu, 18 Jun 2020 16:59:58 +0200 Subject: [PATCH] Add new error about empty expressions. --- relational/parser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/relational/parser.py b/relational/parser.py index d0f9402..7d9d828 100644 --- a/relational/parser.py +++ b/relational/parser.py @@ -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