From: Jürg Billeter Date: Wed, 21 Jul 2010 06:35:45 +0000 (+0200) Subject: dova: Support string equality expressions X-Git-Tag: 0.9.4~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e8d5e4143d5c2638cb31b6e32d8175edfa4fe7b;p=thirdparty%2Fvala.git dova: Support string equality expressions --- diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala index 1ae617594..81bc2ce71 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;