From aa171ac46cb3204c26317a817c04ce724cdf8a2c Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 10 Dec 2018 22:04:58 +0100 Subject: [PATCH] src/as/parser.c: in match_operand() store strings in the AST. --- src/as/parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/as/parser.c b/src/as/parser.c index 9f62eef..36ca98c 100644 --- a/src/as/parser.c +++ b/src/as/parser.c @@ -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;