Add a char type

This commit is contained in:
2025-01-01 23:02:19 +01:00
parent 8176da5f9b
commit 45eb6a3b84
10 changed files with 70 additions and 25 deletions

View File

@@ -71,11 +71,15 @@ false {
return yy::parser::make_IDENTIFIER(yytext, this->location);
}
[0-9]+ {
return yy::parser::make_NUMBER(strtol(yytext, NULL, 10), this->location);
return yy::parser::make_INTEGER(strtol(yytext, NULL, 10), this->location);
}
[0-9]+\.[0-9] {
return yy::parser::make_FLOAT(strtof(yytext, NULL), this->location);
}
'[^']' {
return yy::parser::make_CHARACTER(
std::string(yytext, 1, strlen(yytext) - 2), this->location);
}
\( {
return yy::parser::make_LEFT_PAREN(this->location);
}