asm: implement import and instruction parsing
This commit is contained in:
@@ -28,6 +28,7 @@ static struct lex_token_def keywords[] = {
|
||||
LEX_TOKEN_DEF(IVY_ASM_KW_CONSTPOOL, "@constpool"),
|
||||
LEX_TOKEN_DEF(IVY_ASM_KW_CLASS, "@class"),
|
||||
LEX_TOKEN_DEF(IVY_ASM_KW_BLOCK, "@block"),
|
||||
LEX_TOKEN_DEF(IVY_ASM_KW_PACKAGE, "@package"),
|
||||
LEX_TOKEN_DEF(IVY_ASM_KW_END, "@end"),
|
||||
};
|
||||
static const size_t nr_keywords = sizeof keywords / sizeof keywords[0];
|
||||
@@ -766,6 +767,7 @@ static enum ivy_status read_number(struct ivy_asm_lexer *lex)
|
||||
|
||||
char s[] = {c, 0};
|
||||
b_string_append_cstr(str, s);
|
||||
token_len++;
|
||||
advance(lex);
|
||||
}
|
||||
|
||||
@@ -1030,6 +1032,7 @@ const char *ivy_asm_keyword_to_string(enum ivy_asm_keyword keyword)
|
||||
ENUM_STR(IVY_ASM_KW_CLASS);
|
||||
ENUM_STR(IVY_ASM_KW_BLOCK);
|
||||
ENUM_STR(IVY_ASM_KW_IMPORT);
|
||||
ENUM_STR(IVY_ASM_KW_PACKAGE);
|
||||
ENUM_STR(IVY_ASM_KW_END);
|
||||
default:
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user