summaryrefslogtreecommitdiff
path: root/vala/valacodewriter.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-07-05 07:47:10 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2018-07-05 12:42:00 +0200
commit204c7bae660aa96a1ebf69e33f21128575511394 (patch)
tree2a82498c2577ff140b2689fb1fb1884a6562036b /vala/valacodewriter.vala
parent391ec1209791157845732f2895aa0ef07b0fb6ef (diff)
downloadvala-204c7bae660aa96a1ebf69e33f21128575511394.tar.gz
codewriter: Output bodies of code-blocks if in VAPIGEN mode
Fixes https://gitlab.gnome.org/GNOME/vala/issues/231
Diffstat (limited to 'vala/valacodewriter.vala')
-rw-r--r--vala/valacodewriter.vala10
1 files changed, 6 insertions, 4 deletions
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 4535f8873..985a23182 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -290,7 +290,7 @@ public class Vala.CodeWriter : CodeVisitor {
}
void visit_sorted (List<Symbol> symbols) {
- if (type != CodeWriterType.EXTERNAL) {
+ if (type != CodeWriterType.EXTERNAL && type != CodeWriterType.VAPIGEN) {
// order of virtual methods matters for fast vapis
foreach (Symbol sym in symbols) {
sym.accept (this);
@@ -1590,7 +1590,7 @@ public class Vala.CodeWriter : CodeVisitor {
}
void write_code_block (Block? block) {
- if (block == null || type != CodeWriterType.DUMP) {
+ if (block == null || (type != CodeWriterType.DUMP && type != CodeWriterType.VAPIGEN)) {
write_string (";");
return;
}
@@ -1618,6 +1618,7 @@ public class Vala.CodeWriter : CodeVisitor {
private bool check_accessibility (Symbol sym) {
switch (type) {
case CodeWriterType.EXTERNAL:
+ case CodeWriterType.VAPIGEN:
return sym.access == SymbolAccessibility.PUBLIC ||
sym.access == SymbolAccessibility.PROTECTED;
@@ -1732,7 +1733,7 @@ public class Vala.CodeWriter : CodeVisitor {
write_string ("private ");
}
- if (type != CodeWriterType.EXTERNAL && sym.external && !sym.external_package) {
+ if (type != CodeWriterType.EXTERNAL && type != CodeWriterType.VAPIGEN && sym.external && !sym.external_package) {
write_string ("extern ");
}
}
@@ -1768,5 +1769,6 @@ public enum Vala.CodeWriterType {
EXTERNAL,
INTERNAL,
FAST,
- DUMP
+ DUMP,
+ VAPIGEN
}