diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/lexer.c | 24 | ||||
| -rw-r--r-- | core/parser.c | 6 |
2 files changed, 29 insertions, 1 deletions
diff --git a/core/lexer.c b/core/lexer.c index 6c7a4c9..9705eb7 100644 --- a/core/lexer.c +++ b/core/lexer.c @@ -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; } } diff --git a/core/parser.c b/core/parser.c index 684a1ff..5e86283 100644 --- a/core/parser.c +++ b/core/parser.c @@ -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 |
