1
0
Fork 0
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:
Henrik Hautakoski 2018-12-10 22:04:58 +01:00
parent 7ec84ad2a1
commit aa171ac46c
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -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;