core: Add program data types

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-02-15 18:08:20 -05:00
parent a2a866a010
commit 1ad72ea5a2
4 changed files with 80 additions and 0 deletions

View File

@@ -231,6 +231,28 @@ lexer_check_kw(struct rifle_state *state, struct token *tok)
}
switch (*tok->s) {
case 'u':
if (strcmp(tok->s, "u8") == 0) {
tok->type = TT_U8;
return;
}
if (strcmp(tok->s, "u16") == 0) {
tok->type = TT_U16;
return;
}
if (strcmp(tok->s, "u32") == 0) {
tok->type = TT_U32;
return;
}
if (strcmp(tok->s, "u64") == 0) {
tok->type = TT_U64;
return;
}
break;
case '.':
lexer_check_direc(state, tok);
break;

View File

@@ -61,6 +61,10 @@ static const char *toktab[] = {
[TT_F] = qtok(".f"),
[TT_STRUCT] = qtok(".struct"),
[TT_EXTERN] = qtok(".extern"),
[TT_U8] = qtok("u8"),
[TT_U16] = qtok("u16"),
[TT_U32] = qtok("u32"),
[TT_U64] = qtok("u64"),
[TT_DEFINE] = qtok("#define"),
[TT_IFDEF] = qtok("#ifdef"),
[TT_IFNDEF] = qtok("#ifndef"),