From cd6ca883296a5803cd85d8333b9ef5abb25d7f0e Mon Sep 17 00:00:00 2001 From: tiago Date: Wed, 24 May 2023 18:53:09 +0100 Subject: [PATCH] [PARSER] changes to tables and values --- src/lexer.py | 32 ++++++++++++------------- src/parser.py | 65 ++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 75 insertions(+), 22 deletions(-) diff --git a/src/lexer.py b/src/lexer.py index cb6e149..8e16636 100644 --- a/src/lexer.py +++ b/src/lexer.py @@ -15,9 +15,7 @@ tokens = [ "INF", "NAN", "COMMENT", - ] - - +] # needs to check if datetime is valid @@ -37,19 +35,6 @@ def t_TIME(t): r"\d{2}:\d{2}:\d{2}(\.\d{1,6})?" return t -# ID needs to be the last so it doesnt catch everything (literally) -def t_ID(t): - r"(([\w_]+)|(\"[\w_]+\"\.|\'[\w_]+\'\.)([\w_]+|\"[\w_]+\"|\'[\w_]+\'))(\.([\w_]+|\"[\w_]+\"|\'[\w_]+\'))*" - return t - -def t_MLSTR(t): - r"(\"\"\"(?:[^\"\\]|\\.)+\"\"\")|(\'\'\'(?:[^\'\\]|\\.)+\'\'\')" - return t - -# STR needs to be the first one to catch -def t_STR(t): - r"(?