From 5f3564a3980527bf2c597acb08991df69e9b85d3 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Wed, 9 Sep 2015 16:48:17 +0200 Subject: [PATCH] Fix bug in tokenizer It would not work with relations named like "l3" --- relational/parser.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/relational/parser.py b/relational/parser.py index 7d3a9da..e17fb7a 100644 --- a/relational/parser.py +++ b/relational/parser.py @@ -342,7 +342,7 @@ def tokenize(expression): # Removes the entire parentesis and content from the expression expression = expression[end + 1:].strip() - elif expression.startswith((SELECTION, RENAME, PROJECTION)): # Unary 2 bytes + elif expression.startswith((SELECTION, RENAME, PROJECTION)): # Unary operators items.append(expression[0:1]) # Adding operator in the top of the list expression = expression[ @@ -362,9 +362,6 @@ def tokenize(expression): items.append(expression[0]) expression = expression[1:].strip() # 1 char from the expression state = 4 - elif re.match(rtypes.RELATION_NAME_REGEXP, expression[0]) == None: # At this point we only have relation names, so we raise errors for anything else - raise TokenizerException( - "Unexpected '%c' in '%s'" % (expression[0], expression)) else: # Relation (hopefully) if state == 1: # Previous was a relation, appending to the last token i = items.pop()