From: Brendan Hansen Date: Sat, 18 Jul 2020 00:01:14 +0000 (-0500) Subject: Small bugfix X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=fe3d24d8f3a488b6e57e8c8caf06c772f71b89b2;p=onyx.git Small bugfix --- diff --git a/onyx b/onyx index a645223c..e31cecd7 100755 Binary files a/onyx and b/onyx differ diff --git a/src/onyxchecker.c b/src/onyxchecker.c index 97b18cb7..90a3e6ca 100644 --- a/src/onyxchecker.c +++ b/src/onyxchecker.c @@ -213,7 +213,7 @@ static b32 check_binaryop(SemState* state, AstBinaryOp* binop) { if (!is_lval((AstNode *) binop->left)) { onyx_message_add(state->msgs, ONYX_MESSAGE_TYPE_NOT_LVAL, - binop->token->pos, + binop->left->token->pos, binop->left->token->text, binop->left->token->length); return 1; } diff --git a/src/onyxparser.c b/src/onyxparser.c index 85c1d753..a6c5d20a 100644 --- a/src/onyxparser.c +++ b/src/onyxparser.c @@ -268,9 +268,9 @@ static AstTyped* parse_factor(OnyxParser* parser) { } while (parser->curr->type == Token_Type_Keyword_Cast) { - consume_token(parser); AstUnaryOp* cast_node = make_node(AstUnaryOp, Ast_Kind_Unary_Op); + cast_node->token = expect_token(parser, Token_Type_Keyword_Cast); cast_node->type_node = parse_type(parser); cast_node->operation = Unary_Op_Cast; cast_node->expr = retval;