summaryrefslogtreecommitdiff
path: root/ccode/valaccodeifstatement.vala
diff options
context:
space:
mode:
Diffstat (limited to 'ccode/valaccodeifstatement.vala')
-rw-r--r--ccode/valaccodeifstatement.vala18
1 files changed, 9 insertions, 9 deletions
diff --git a/ccode/valaccodeifstatement.vala b/ccode/valaccodeifstatement.vala
index 31a7da996..c4522302e 100644
--- a/ccode/valaccodeifstatement.vala
+++ b/ccode/valaccodeifstatement.vala
@@ -30,29 +30,29 @@ public class Vala.CCodeIfStatement : CCodeStatement {
* The boolean condition to evaluate.
*/
public CCodeExpression condition { get; set; }
-
+
/**
* The statement to be evaluated if the condition holds.
*/
public CCodeStatement true_statement { get; set; }
-
+
/**
* The optional statement to be evaluated if the condition doesn't hold.
*/
public CCodeStatement? false_statement { get; set; }
-
+
public CCodeIfStatement (CCodeExpression cond, CCodeStatement true_stmt, CCodeStatement? false_stmt = null) {
condition = cond;
true_statement = true_stmt;
false_statement = false_stmt;
}
-
+
/**
* Specifies whether this if statement is part of an else if statement.
* This only affects the output formatting.
*/
public bool else_if { get; set; }
-
+
public override void write (CCodeWriter writer) {
if (!else_if) {
writer.write_indent (line);
@@ -64,13 +64,13 @@ public class Vala.CCodeIfStatement : CCodeStatement {
condition.write (writer);
}
writer.write_string (")");
-
+
/* else shouldn't be on a separate line */
if (false_statement != null && true_statement is CCodeBlock) {
var cblock = (CCodeBlock) true_statement;
cblock.suppress_newline = true;
}
-
+
true_statement.write (writer);
if (false_statement != null) {
if (writer.bol) {
@@ -79,13 +79,13 @@ public class Vala.CCodeIfStatement : CCodeStatement {
} else {
writer.write_string (" else");
}
-
+
/* else if should be on one line */
if (false_statement is CCodeIfStatement) {
var cif = (CCodeIfStatement) false_statement;
cif.else_if = true;
}
-
+
false_statement.write (writer);
}
}