diff -r ea63f1680097 -r c22e983b3b6e src/compiler/SemanticAnalysis.cpp --- a/src/compiler/SemanticAnalysis.cpp Sun Nov 18 15:26:12 2012 -0800 +++ b/src/compiler/SemanticAnalysis.cpp Sun Nov 18 15:50:41 2012 -0800 @@ -586,6 +586,31 @@ right); } +void +SemanticAnalysis::visitIncDecExpression(IncDecExpression *node) +{ + HLValue *lval = lvalue(node->expression()); + if (!lval) + return; + + if (!lval->type()->isInt32() && !lval->type()->isFloat()) { + assert(false); + return; + } + + HIR *rval; + if (lval->type()->isInt32()) + rval = new (pool_) HInteger(lval->type(), 1); + else + rval = new (pool_) HFloat(lval->type(), 1.0); + + if (node->postfix()) { + assert(false); + } else { + hir_ = new (pool_) HStore(node->token(), lval, rval); + } +} + Type * SemanticAnalysis::coercionType(TokenKind token, HIR *left, HIR *right) {