[vala/staging] vala: Add UnaryOperator.to_string()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] vala: Add UnaryOperator.to_string()
- Date: Thu, 15 Nov 2018 16:48:35 +0000 (UTC)
commit bddb420a814a4f19dd2ed93d7896557aa73974b1
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Nov 15 17:26:19 2018 +0100
vala: Add UnaryOperator.to_string()
vala/valaunaryexpression.vala | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala
index 7ccbecb1d..ce5e4a062 100644
--- a/vala/valaunaryexpression.vala
+++ b/vala/valaunaryexpression.vala
@@ -77,22 +77,8 @@ public class Vala.UnaryExpression : Expression {
}
}
- private unowned 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 ";
- default: assert_not_reached ();
- }
- }
-
public override string to_string () {
- return get_operator_string () + _inner.to_string ();
+ return operator.to_string () + _inner.to_string ();
}
public override bool is_constant () {
@@ -291,5 +277,20 @@ public enum Vala.UnaryOperator {
INCREMENT,
DECREMENT,
REF,
- OUT
+ OUT;
+
+ public unowned string to_string () {
+ switch (this) {
+ case PLUS: return "+";
+ case MINUS: return "-";
+ case LOGICAL_NEGATION: return "!";
+ case BITWISE_COMPLEMENT: return "~";
+ case INCREMENT: return "++";
+ case DECREMENT: return "--";
+ case REF: return "ref ";
+ case OUT: return "out ";
+ default: assert_not_reached ();
+ }
+ }
+
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]