hyc

Hydrogen Compiler written in C
git clone git://git.kocotian.pl/hyc.git
Log | Files | Refs | README | LICENSE

commit 0486e43902034d3189c3901df4fbab0cd3af9e2a
parent 4b48b5da9a6d75af840d7c1da00ebe432b35e037
Author: kocotian <kocotian@kocotian.pl>
Date:   Fri, 30 Jul 2021 22:36:05 +0000

Unary Addressof operator

Diffstat:
Mtarget/x86_64-linux.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/target/x86_64-linux.c b/target/x86_64-linux.c @@ -238,6 +238,14 @@ compileExpressionUnarySignChange(Compiler *compiler, ASTExpressionUnary expr) static void compileExpressionUnaryAddressof(Compiler *compiler, ASTExpressionUnary expr) { + switch (expr.expr->type) { + case ASTExpressionLiteralIdentifier_T: + compileExpressionLiteralIdentifier(compiler, expr.expr->Literal, 1); + break; + default: + die("cannot get address of expression which is not lvalue"); /* TODO: error() */ + break; + } } static void