fixes and improvements
exceptions related code needs work
This commit is contained in:
14
lexer.cpp
14
lexer.cpp
@@ -13,12 +13,12 @@ namespace usql {
|
||||
|
||||
Lexer::Lexer() {
|
||||
k_words_regex =
|
||||
"[0-9]+\\.[0-9]+|[0-9][0-9_]+[0-9]|[0-9]+|[A-Za-z]+[A-Za-z0-9_#]*|[\\(\\)\\[\\]\\{\\}]|[-\\+\\*/"
|
||||
"[-+]?[0-9]+\\.[0-9]+|[-+]?[0-9][0-9_]+[0-9]|[0-9]+|[A-Za-z]+[A-Za-z0-9_#]*|[\\(\\)\\[\\]\\{\\}]|[-\\+\\*/"
|
||||
",;:\?]|==|>=|<=|~=|>|<|=|;|~|\\||or|and|\n|\r|\r\n|'([^']|'')*'|\".*?\"|%.*?\n";
|
||||
k_int_regex = "[0-9]+";
|
||||
k_int_underscored_regex = "[0-9][0-9_]+[0-9]";
|
||||
k_double_regex = "[0-9]+\\.[0-9]+";
|
||||
k_identifier_regex = "[A-Za-z]+[A-Za-z0-9_#]*";
|
||||
k_int_regex = "[-+]?[0-9]+";
|
||||
k_int_underscored_regex = "[-+]?[0-9][0-9_]+[0-9]";
|
||||
k_double_regex = "[-+]?[0-9]+\\.[0-9]+";
|
||||
k_identifier_regex = "[A-Za-z]+[A-Za-z0-9_#]*";
|
||||
}
|
||||
|
||||
void Lexer::parse(const std::string &code) {
|
||||
@@ -208,7 +208,7 @@ namespace usql {
|
||||
return TokenType::keyword_null;
|
||||
|
||||
if (token == "integer")
|
||||
return TokenType::keyword_int;
|
||||
return TokenType::keyword_integer;
|
||||
|
||||
if (token == "float")
|
||||
return TokenType::keyword_float;
|
||||
@@ -374,7 +374,7 @@ namespace usql {
|
||||
case TokenType::keyword_null:
|
||||
txt = "null";
|
||||
break;
|
||||
case TokenType::keyword_int:
|
||||
case TokenType::keyword_integer:
|
||||
txt = "integer";
|
||||
break;
|
||||
case TokenType::keyword_float:
|
||||
|
||||
Reference in New Issue
Block a user