core: Add program data types
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
22
core/lexer.c
22
core/lexer.c
@@ -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;
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user