diff options
Diffstat (limited to 'cgen.c')
-rw-r--r-- | cgen.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -698,7 +698,8 @@ static bool cgen_expr_pre(CGenerator *g, Expression *e) { break; case EXPR_BINARY_OP: if (!cgen_expr_pre(g, e->binary.lhs)) return false; - if (!cgen_expr_pre(g, e->binary.rhs)) return false; + if (e->binary.op != BINARY_DOT) + if (!cgen_expr_pre(g, e->binary.rhs)) return false; break; case EXPR_CAST: if (!cgen_expr_pre(g, e->cast.expr)) return false; @@ -862,6 +863,14 @@ static bool cgen_expr(CGenerator *g, Expression *e) { cgen_write(g, ")"); handled = true; break; + case BINARY_DOT: + cgen_write(g, "("); + cgen_expr(g, e->binary.lhs); + cgen_write(g, "."); + cgen_ident(g, e->binary.field->name); + cgen_write(g, ")"); + handled = true; + break; } if (handled) break; cgen_write(g, "("); |