From 1ca77f60626666fba792db407dd11ea9b597d9cf Mon Sep 17 00:00:00 2001 From: lemon Date: Tue, 16 Aug 2022 09:19:33 +0200 Subject: binary operators and more stuff --- bootstrap/cgen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bootstrap/cgen.c') diff --git a/bootstrap/cgen.c b/bootstrap/cgen.c index 15fab93..0887ca7 100644 --- a/bootstrap/cgen.c +++ b/bootstrap/cgen.c @@ -288,7 +288,10 @@ genexpr(struct expr *ex) { ++id; break; case Elen: - pri("%e.len", ex->child); + pri("%e%slen", ex->child, ex->child->ty->t == TYptr ? "->" : "."); + break; + case Eptr: + pri("%e%sptr", ex->child, ex->child->ty->t == TYptr ? "->" : "."); break; case Eeutag: pri("%e%st", ex->child, ex->child->ty->t == TYptr ? "->" : "."); @@ -518,7 +521,7 @@ liftnestedex(struct expr *ex) { case Eblock: liftnested(blocktostmt(ex->block)); break; - case Eas: case Elen: case Eeutag: + case Eas: case Elen: case Eeutag: case Eptr: liftnestedex(ex->child); break; case Eini: -- cgit v1.2.3