lexer adding is_number

This commit is contained in:
hugogogo
2026-04-28 23:42:25 +02:00
parent fb81f200d9
commit 5108571deb
4 changed files with 152 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ typedef enum
{
ERROR_BASIC = 0,
ERROR_UNKNOWN_TOKEN = -1,
ERROR_NUMBER_TOO_BIG = -2,
} program_error;
int stop_errors(int err);

View File

@@ -5,11 +5,11 @@
typedef enum
{
TOKEN_PLUS, // +
TOKEN_MINUS, // -
TOKEN_VARIABLE, // x, y, etc.
TOKEN_NUMBER, // int or double
TOKEN_POWER, // ^ or **
TOKEN_PLUS, // +
TOKEN_MINUS, // -
TOKEN_MULTIPLICATION, // *
TOKEN_DIVISION, // /
TOKEN_END // null (end of input)