2008-02-29 Jürg Billeter <j@bitron.ch>
+ * vala/valabinaryexpression.vala, vala/valaunaryexpression.vala:
+ support binary expressions in default arguments
+
+2008-02-29 Jürg Billeter <j@bitron.ch>
+
* gobject/valaccodegeneratorinterface.vala,
gobject/valaccodegeneratorsignal.vala: support GLib.Error as
signal parameter type, fixes bug 519415
/* valabinaryexpression.vala
*
- * Copyright (C) 2006-2007 Jürg Billeter
+ * Copyright (C) 2006-2008 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
}
}
+ private string! get_operator_string () {
+ switch (_operator) {
+ case BinaryOperator.PLUS: return "+";
+ case BinaryOperator.MINUS: return "-";
+ case BinaryOperator.MUL: return "*";
+ case BinaryOperator.DIV: return "/";
+ case BinaryOperator.MOD: return "%";
+ case BinaryOperator.SHIFT_LEFT: return "<<";
+ case BinaryOperator.SHIFT_RIGHT: return ">>";
+ case BinaryOperator.LESS_THAN: return "<";
+ case BinaryOperator.GREATER_THAN: return ">";
+ case BinaryOperator.LESS_THAN_OR_EQUAL: return "<=";
+ case BinaryOperator.GREATER_THAN_OR_EQUAL: return ">=";
+ case BinaryOperator.EQUALITY: return "==";
+ case BinaryOperator.INEQUALITY: return "!+";
+ case BinaryOperator.BITWISE_AND: return "&";
+ case BinaryOperator.BITWISE_OR: return "|";
+ case BinaryOperator.BITWISE_XOR: return "^";
+ case BinaryOperator.AND: return "&&";
+ case BinaryOperator.OR: return "||";
+ case BinaryOperator.IN: return "in";
+ }
+
+ assert_not_reached ();
+ }
+
+ public override string! to_string () {
+ return _left.to_string () + get_operator_string () + _right.to_string ();
+ }
+
public override bool is_pure () {
return left.is_pure () && right.is_pure ();
}
/* valaunaryexpression.vala
*
- * Copyright (C) 2006-2007 Jürg Billeter
+ * Copyright (C) 2006-2008 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
}
}
- public string! operator_string {
- get {
- switch (_operator) {
- case UnaryOperator.PLUS: return "+";
- case UnaryOperator.MINUS: return "-";
- case UnaryOperator.LOGICAL_NEGATION: return "!";
- case UnaryOperator.BITWISE_COMPLEMENT: return "~";
- case UnaryOperator.INCREMENT: return "++";
- case UnaryOperator.DECREMENT: return "--";
- case UnaryOperator.REF: return "ref ";
- case UnaryOperator.OUT: return "out ";
- }
-
- assert_not_reached ();
+ private string! get_operator_string () {
+ switch (_operator) {
+ case UnaryOperator.PLUS: return "+";
+ case UnaryOperator.MINUS: return "-";
+ case UnaryOperator.LOGICAL_NEGATION: return "!";
+ case UnaryOperator.BITWISE_COMPLEMENT: return "~";
+ case UnaryOperator.INCREMENT: return "++";
+ case UnaryOperator.DECREMENT: return "--";
+ case UnaryOperator.REF: return "ref ";
+ case UnaryOperator.OUT: return "out ";
}
+
+ assert_not_reached ();
}
public override string! to_string () {
- return operator_string + _inner.to_string ();
+ return get_operator_string () + _inner.to_string ();
}
public override bool is_pure () {