[vala/staging: 3/5] vala: Drop RealLiteral.get_type_name()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 3/5] vala: Drop RealLiteral.get_type_name()
- Date: Fri, 1 Oct 2021 18:53:05 +0000 (UTC)
commit 76a08b801f5f0db5322d4c6d5bd17cae4f1ab337
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Sep 28 17:42:47 2021 +0200
vala: Drop RealLiteral.get_type_name()
vala/valarealliteral.vala | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/vala/valarealliteral.vala b/vala/valarealliteral.vala
index 9c1e7d86e..2924cd764 100644
--- a/vala/valarealliteral.vala
+++ b/vala/valarealliteral.vala
@@ -49,19 +49,6 @@ public class Vala.RealLiteral : Literal {
visitor.visit_expression (this);
}
- /**
- * Returns the type name of the value this literal represents.
- *
- * @return the name of literal type
- */
- public string get_type_name () {
- if (value.has_suffix ("f") || value.has_suffix ("F")) {
- return "float";
- }
-
- return "double";
- }
-
public override bool is_pure () {
return true;
}
@@ -77,7 +64,14 @@ public class Vala.RealLiteral : Literal {
checked = true;
- var st = (Struct) context.root.scope.lookup (get_type_name ());
+ string type_name;
+ if (value.has_suffix ("f") || value.has_suffix ("F")) {
+ type_name ="float";
+ } else {
+ type_name = "double";
+ }
+
+ var st = (Struct) context.root.scope.lookup (type_name);
// ensure attributes are already processed
st.check (context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]