core: lexer: Add unsigned type tokens
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user