diff options
| author | 2022-08-16 09:19:33 +0200 | |
|---|---|---|
| committer | 2022-08-16 09:19:33 +0200 | |
| commit | 1ca77f60626666fba792db407dd11ea9b597d9cf (patch) | |
| tree | 0e5ea52e457474899ad5f0076bbe658e67626925 /bootstrap/cgen.c | |
| parent | 04c7892134d49f3b295a51cc741affe9f02e374d (diff) | |
binary operators and more stuff
Diffstat (limited to 'bootstrap/cgen.c')
| -rw-r--r-- | bootstrap/cgen.c | 7 |
1 files changed, 5 insertions, 2 deletions
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: |