|
@@ -1239,12 +1239,11 @@ and gen_expression ctx retval expression =
|
|
gen_expression_list expressions;
|
|
gen_expression_list expressions;
|
|
output ")"
|
|
output ")"
|
|
| TUnop (Ast.NegBits,Ast.Prefix,expr) ->
|
|
| TUnop (Ast.NegBits,Ast.Prefix,expr) ->
|
|
- ctx.ctx_assigning <- true;
|
|
|
|
output "~(int)(";
|
|
output "~(int)(";
|
|
gen_expression ctx true expr;
|
|
gen_expression ctx true expr;
|
|
output ")"
|
|
output ")"
|
|
| TUnop (op,Ast.Prefix,expr) ->
|
|
| TUnop (op,Ast.Prefix,expr) ->
|
|
- ctx.ctx_assigning <- true;
|
|
|
|
|
|
+ ctx.ctx_assigning <- (match op with Ast.Increment | Ast.Decrement -> true | _ ->false);
|
|
output (Ast.s_unop op);
|
|
output (Ast.s_unop op);
|
|
output "(";
|
|
output "(";
|
|
gen_expression ctx true expr;
|
|
gen_expression ctx true expr;
|
|
@@ -1310,22 +1309,13 @@ and gen_expression ctx retval expression =
|
|
| "Void" -> "Dynamic"
|
|
| "Void" -> "Dynamic"
|
|
| other -> other
|
|
| other -> other
|
|
in
|
|
in
|
|
- if ( true (*(type_string if_expr.etype) <> type_str*) ) then begin
|
|
|
|
- output (type_str ^ "( ");
|
|
|
|
- gen_expression ctx true if_expr;
|
|
|
|
- output " )";
|
|
|
|
- end else
|
|
|
|
- gen_expression ctx true if_expr;
|
|
|
|
|
|
+ output (type_str ^ "(");
|
|
|
|
+ gen_expression ctx true if_expr;
|
|
|
|
+ output ") : ";
|
|
|
|
|
|
- output " : ";
|
|
|
|
-
|
|
|
|
- if ( true (*(type_string else_expr.etype) <> type_str*) ) then begin
|
|
|
|
- output (type_str ^ "( ");
|
|
|
|
- gen_expression ctx true else_expr;
|
|
|
|
- output " )";
|
|
|
|
- end else
|
|
|
|
- gen_expression ctx true else_expr;
|
|
|
|
- output " )";
|
|
|
|
|
|
+ output (type_str ^ "(");
|
|
|
|
+ gen_expression ctx true else_expr;
|
|
|
|
+ output ") )";
|
|
end else begin
|
|
end else begin
|
|
output "if (";
|
|
output "if (";
|
|
gen_expression ctx true condition;
|
|
gen_expression ctx true condition;
|