|
@@ -2362,6 +2362,9 @@ void HqlCppTranslator::buildExprAssign(BuildCtx & ctx, const CHqlBoundTarget & t
|
|
|
buildStmt(ctx, expr->queryChild(0));
|
|
|
buildExprAssign(ctx, target, expr->queryChild(1));
|
|
|
break;
|
|
|
+ case no_executewhen:
|
|
|
+ doBuildAssignExecuteWhen(ctx, target, expr);
|
|
|
+ break;
|
|
|
case no_concat:
|
|
|
doBuildAssignConcat(ctx, target, expr);
|
|
|
break;
|
|
@@ -3178,6 +3181,7 @@ void HqlCppTranslator::buildExpr(BuildCtx & ctx, IHqlExpression * expr, CHqlBoun
|
|
|
case no_loopcounter:
|
|
|
case no_toxml:
|
|
|
case no_tojson:
|
|
|
+ case no_executewhen:
|
|
|
buildTempExpr(ctx, expr, tgt);
|
|
|
return;
|
|
|
case no_asstring:
|
|
@@ -7212,6 +7216,34 @@ void HqlCppTranslator::doBuildAssignConcat(BuildCtx & ctx, const CHqlBoundTarget
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void HqlCppTranslator::doBuildAssignExecuteWhen(BuildCtx & ctx, const CHqlBoundTarget & target, IHqlExpression * expr)
|
|
|
+{
|
|
|
+ IHqlExpression * value = expr->queryChild(0);
|
|
|
+ IHqlExpression * action = expr->queryChild(1);
|
|
|
+
|
|
|
+ if (expr->hasAttribute(beforeAtom))
|
|
|
+ {
|
|
|
+ buildStmt(ctx, action);
|
|
|
+ buildExprAssign(ctx, target, value);
|
|
|
+ }
|
|
|
+ else if (expr->hasAttribute(failureAtom))
|
|
|
+ {
|
|
|
+ BuildCtx tryctx(ctx);
|
|
|
+ tryctx.addTry();
|
|
|
+ buildExprAssign(tryctx, target, value);
|
|
|
+
|
|
|
+ BuildCtx catchctx(ctx);
|
|
|
+ catchctx.addCatch(NULL);
|
|
|
+ buildStmt(catchctx, action);
|
|
|
+ catchctx.addThrow(NULL);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ buildExprAssign(ctx, target, value);
|
|
|
+ buildStmt(ctx, action);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//---------------------------------------------------------------------------
|
|
|
//-- no_div --
|
|
|
// also used for no_modulus
|