core: lexer: Add unsigned type tokens

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-05-23 08:52:56 -04:00
parent 62451acdd4
commit a6f776e1f2
3 changed files with 33 additions and 1 deletions
+24
View File
@@ -186,6 +186,30 @@ lexer_check_kw(struct cescal_state *state, struct token *res)
res->type = TT_RETURN;
return;
}
break;
case 'u':
if (strcmp(res->s, "u8") == 0) {
res->type = TT_U8;
return;
}
if (strcmp(res->s, "u16") == 0) {
res->type = TT_U16;
return;
}
if (strcmp(res->s, "u32") == 0) {
res->type = TT_U32;
return;
}
if (strcmp(res->s, "u64") == 0) {
res->type = TT_U64;
return;
}
break;
}
}
+5 -1
View File
@@ -45,7 +45,11 @@ static const char *toktab[] = {
[TT_PUB] = qtok("pub"),
[TT_PROC] = qtok("proc"),
[TT_BEGIN] = qtok("begin"),
[TT_END] = qtok("end")
[TT_END] = qtok("end"),
[TT_U8] = qtok("u8"),
[TT_U16] = qtok("u16"),
[TT_U32] = qtok("u32"),
[TT_U64] = qtok("u64")
};
int