protected void ResolveIfStmt(AstIfStmt stmt) { ResolveExpr(stmt.m_condition); ResolveStmt(stmt.m_body); if (stmt.m_else != null) { ResolveStmt(stmt.m_else); } }
// TODO: Add vardecl to if statement? protected void ExecuteIfStmt(AstIfStmt stmt) { if (HadErrorOrReturn()) { return; } object conditionalValue = EvaluateExpr(stmt.m_condition); if (IsTruthy(conditionalValue)) { ExecuteStmt(stmt.m_body); } else if (stmt.m_else != null) { ExecuteStmt(stmt.m_else); } }