fix: cannot scan 0 as int

This commit is contained in:
Eatswap 2022-12-11 20:11:17 +08:00
parent 60b3da0087
commit 8bec6e3f56
Signed by: Eatswap
GPG Key ID: BE661106A1F3FA0B
1 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ using token = DragonLisp::DLParser::token;
%option verbose backup warn noyywrap c++ nounistd debug noline
float [+-]?[0-9]*[.][0-9]+([eE][+-][0-9]+)?
int [+-]?(0[xX][0-9A-Fa-f]*|0[0-7]+|[1-9][0-9]*)
int [+-]?(0[xX][0-9A-Fa-f]*|0[0-7]*|[1-9][0-9]*)
id [a-zA-Z_][a-zA-Z_0-9]*
blank [ \t\v\r]
comment ;[^\n\r]*
@ -68,14 +68,14 @@ defconstant [dD][eE][fF][cC][oO][nN][sS][tT][aA][nN][tT]
{blank}+ {
loc->step();
std::printf("Skipping blank\n");
// std::printf("Skipping blank\n");
// return token::TOKEN_SPACE;
};
\n+ {
loc->lines(yyleng);
loc->step();
std::printf("Skipping newline\n");
// std::printf("Skipping newline\n");
// return token::TOKEN_SPACE;
}