[vala] fix bug in printing string literal in Genie
- From: Jamie McCracken <jamiemcc src gnome org>
- To: svn-commits-list gnome org
- Subject: [vala] fix bug in printing string literal in Genie
- Date: Tue, 14 Apr 2009 13:42:50 -0400 (EDT)
commit f8ae071a2c343fd410f93d3891d67e315c34acd8
Author: Jamie McCracken <jamiemcc gnome org>
Date: Tue Apr 14 13:41:57 2009 -0400
fix bug in printing string literal in Genie
---
vala/valagenieparser.vala | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 870a90f..3973e5f 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -744,18 +744,20 @@ public class Vala.Genie.Parser : CodeVisitor {
i++;
if (p_expr != null) {
- string s = "\"\\n\"";
+
if (p_expr is StringLiteral) {
var s_exp = (StringLiteral) p_expr;
var len = s_exp.value.size ();
if (len > 2) {
+ string s = "\\n\"";
var st = s_exp.value.ndup (len-1);
st += s;
s_exp.value = st;
}
} else {
+ string s = "\"\\n\"";
var rhs = new StringLiteral (s, get_src (begin));
p_expr = new BinaryExpression (BinaryOperator.PLUS, p_expr, rhs, get_src (begin));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]