[vala] CodeWriter: Write accessibility for property accessors
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] CodeWriter: Write accessibility for property accessors
- Date: Sat, 16 Oct 2010 10:41:12 +0000 (UTC)
commit b4b1c4be13bf03fd877041865ac08e6b88b8e7f0
Author: Jürg Billeter <j bitron ch>
Date: Sat Oct 16 11:24:21 2010 +0200
CodeWriter: Write accessibility for property accessors
vala/valacodewriter.vala | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 0fd6f95..9904bbd 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -1228,6 +1228,8 @@ public class Vala.CodeWriter : CodeVisitor {
write_string ("[CCode (%s)]".printf (ccode_params.str));
}
+ write_property_accessor_accessibility (prop.get_accessor);
+
if (context.profile != Profile.DOVA && prop.get_accessor.value_type.is_disposable ()) {
write_string (" owned");
}
@@ -1248,6 +1250,8 @@ public class Vala.CodeWriter : CodeVisitor {
write_string ("[CCode (%s)]".printf (ccode_params.str));
}
+ write_property_accessor_accessibility (prop.set_accessor);
+
if (context.profile != Profile.DOVA && prop.set_accessor.value_type.value_owned) {
write_string (" owned");
}
@@ -2019,6 +2023,16 @@ public class Vala.CodeWriter : CodeVisitor {
write_string ("extern ");
}
}
+
+ void write_property_accessor_accessibility (Symbol sym) {
+ if (sym.access == SymbolAccessibility.PROTECTED) {
+ write_string (" protected");
+ } else if (sym.access == SymbolAccessibility.INTERNAL) {
+ write_string (" internal");
+ } else if (sym.access == SymbolAccessibility.PRIVATE) {
+ write_string (" private");
+ }
+ }
}
public enum Vala.CodeWriterType {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]