[vala] dova: Support string equality expressions
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] dova: Support string equality expressions
- Date: Wed, 21 Jul 2010 06:50:33 +0000 (UTC)
commit 1e8d5e4143d5c2638cb31b6e32d8175edfa4fe7b
Author: Jürg Billeter <j bitron ch>
Date: Wed Jul 21 08:35:45 2010 +0200
dova: Support string equality expressions
vala/valabinaryexpression.vala | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index 1ae6175..81bc2ce 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -413,6 +413,18 @@ public class Vala.BinaryExpression : Expression {
if (left.value_type.compatible (analyzer.string_type)
&& right.value_type.compatible (analyzer.string_type)) {
// string comparison
+ if (analyzer.context.profile == Profile.DOVA) {
+ var equals_call = new MethodCall (new MemberAccess (left, "equals", source_reference), source_reference);
+ equals_call.add_argument (right);
+ if (operator == BinaryOperator.EQUALITY) {
+ parent_node.replace_expression (this, equals_call);
+ return equals_call.check (analyzer);
+ } else {
+ var not = new UnaryExpression (UnaryOperator.LOGICAL_NEGATION, equals_call, source_reference);
+ parent_node.replace_expression (this, not);
+ return not.check (analyzer);
+ }
+ }
}
value_type = analyzer.bool_type;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]