diff --git a/src/parser/lexer.l b/src/parser/lexer.l index d31d458..ed19a27 100644 --- a/src/parser/lexer.l +++ b/src/parser/lexer.l @@ -50,7 +50,7 @@ DIGIT [0-9] "true" {yylval.value = new Node(VALUE, std::unique_ptr(make_true()), ""); return VALUE;} "false" {yylval.value = new Node(VALUE, std::unique_ptr(make_false()), ""); return VALUE;} \".*\" {yylval.value = new Node(VALUE, std::unique_ptr(make_string(substring(yytext, 1, strlen(yytext) - 1))), ""); return VALUE; } -{DIGIT} {std::vector nums; nums.push_back(atoi(yytext)); yylval.value = new Node(VALUE, std::unique_ptr(make_long(nums)), ""); return VALUE;} +{DIGIT}+ {std::vector nums; nums.push_back(atoi(yytext)); yylval.value = new Node(VALUE, std::unique_ptr(make_long(nums)), ""); return VALUE;} {DIGIT}*"."?{DIGIT}+ {std::vector decs; decs.push_back(atof(yytext)); yylval.value = new Node(VALUE, std::unique_ptr(make_double(decs)), ""); return VALUE;} [_a-zA-Z][_a-zA-Z0-9]* {yylval.value = new Node(IDENTIFIER, std::unique_ptr(nullptr), yytext); return IDENTIFIER;} [\n] {linenum++;}