[vala] Genie: Fixed use of print statements when variables are null
- From: Jamie McCracken <jamiemcc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Genie: Fixed use of print statements when variables are null
- Date: Sun, 8 Sep 2013 23:18:40 +0000 (UTC)
commit fd35b034e2d016c5b4e24d39ecc711d44a18da81
Author: Jamie McCracken <jamie mccrack gmail com>
Date: Sun Sep 8 19:18:14 2013 -0400
Genie: Fixed use of print statements when variables are null
vala/valagenieparser.vala | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 01b89d6..f479905 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -835,8 +835,6 @@ public class Vala.Genie.Parser : CodeVisitor {
i++;
if (p_expr != null) {
-
-
if (p_expr is StringLiteral) {
var s_exp = (StringLiteral) p_expr;
var len = s_exp.value.length;
@@ -846,14 +844,16 @@ public class Vala.Genie.Parser : CodeVisitor {
var st = s_exp.value.substring (0, len-1);
st += s;
s_exp.value = st;
+ } else {
+ string s = "\"\\n\"";
+ p_expr = new StringLiteral (s, get_src
(begin));
}
} else {
- string s = "\"\\n\"";
- var rhs = new StringLiteral (s, get_src (begin));
- p_expr = new BinaryExpression (BinaryOperator.PLUS,
p_expr, rhs, get_src (begin));
+ string s = "\"%s\\n\"";
+ var s_exp = new StringLiteral (s, get_src (begin));
+ list.add (s_exp);
}
}
-
}
list.add (p_expr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]