mirror of
https://github.com/pnx/m16vm
synced 2026-06-16 03:44:55 +02:00
src/as/parser.c: in match_operand() store strings in the AST.
This commit is contained in:
parent
7ec84ad2a1
commit
aa171ac46c
1 changed files with 3 additions and 1 deletions
|
|
@ -46,8 +46,10 @@ static int match_operand(struct lexer* lex, enum token_type type, struct ast *as
|
|||
|
||||
if (type == TOKEN_REG) {
|
||||
ast_instr_operand(ast, DATATYPE_REGISTER, lex->token.value.n);
|
||||
} else {
|
||||
} else if (type == TOKEN_NUMBER) {
|
||||
ast_instr_operand(ast, DATATYPE_NUMBER, lex->token.value.n);
|
||||
} else {
|
||||
ast_instr_operand(ast, DATATYPE_STRING, lex->token.value.s);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue