lexer fix

This commit is contained in:
2025-07-20 22:40:11 +03:00
parent deee9564ac
commit 17d88444d1

View File

@@ -23,6 +23,7 @@ typedef enum{
TOKEN_PLUS, TOKEN_PLUS,
TOKEN_MINUS, TOKEN_MINUS,
TOKEN_INTEGER, TOKEN_INTEGER,
TOKEN_SPACE,
intdef, intdef,
TOKEN_UNKNOWN, TOKEN_UNKNOWN,
} symbols; } symbols;
@@ -78,8 +79,12 @@ Token read_from_tok(char* text, uint cursor){
mytoks.type = TOKEN_MINUS; mytoks.type = TOKEN_MINUS;
mytoks.text = "-"; mytoks.text = "-";
break; break;
case ' ':
mytoks.type = TOKEN_SPACE;
mytoks.text = "space";
break;
default: default:
mytoks.type = TOKEN_UNKNOWN; mytoks.type = TOKEN_UNKNOWN;
} }
} }
return mytoks; return mytoks;