fix: tests and implementation of lexer

Just a few details here and there, nothing wrong, everything else is
going well.
This commit is contained in:
2026-04-30 09:58:27 -06:00
parent 630d9f53e1
commit ac2e783ccc
5 changed files with 20 additions and 28 deletions

View File

@@ -87,9 +87,10 @@ ASTNodeResult tokenize_number(const char *input, size_t *offset) {
if (is_integer) {
new_node.type = NODE_INTEGER;
I64Result status = string_to_integer(buf);
if (status.is_valid == LEXER_OK) {
new_node.data.integer = status.number;
if (!status.is_valid) {
return (ASTNodeResult) {.is_valid = false, .err = status.err};
}
new_node.data.integer = status.number;
*offset = current;
return (ASTNodeResult) {.is_valid = true, .node = new_node};
}