[vala/wip/transform: 105/132] Visit all nodes for transformation, not only the source ones
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/transform: 105/132] Visit all nodes for transformation, not only the source ones
- Date: Mon, 16 Apr 2018 15:11:39 +0000 (UTC)
commit 5b8f01f5465daa197bc8ae8eaf94adb97c5468a1
Author: Luca Bruno <lucabru src gnome org>
Date: Sat Feb 1 10:22:41 2014 +0100
Visit all nodes for transformation, not only the source ones
codegen/valaccodetransformer.vala | 6 +++++-
vala/valacodetransformer.vala | 9 +++------
vala/valaelementaccess.vala | 2 +-
3 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index 8e28b1f..b63c202 100644
--- a/codegen/valaccodetransformer.vala
+++ b/codegen/valaccodetransformer.vala
@@ -70,6 +70,10 @@ public class Vala.CCodeTransformer : CodeTransformer {
}
public override void visit_method (Method m) {
+ if (m.body == null) {
+ return;
+ }
+
m.accept_children (this);
}
@@ -421,7 +425,7 @@ public class Vala.CCodeTransformer : CodeTransformer {
Expression replacement = null;
var old_parent_node = expr.parent_node;
- var target_type = expr.target_type != null ? expr.target_type.copy () : null;
+ var target_type = copy_type (expr.target_type);
push_builder (new CodeBuilder (context, parent_statement, expr.source_reference));
if (context.analyzer.get_current_non_local_symbol (expr) is Block
diff --git a/vala/valacodetransformer.vala b/vala/valacodetransformer.vala
index 86e3a2d..3e9f6ff 100644
--- a/vala/valacodetransformer.vala
+++ b/vala/valacodetransformer.vala
@@ -54,12 +54,9 @@ public class Vala.CodeTransformer : CodeVisitor {
/* we're only interested in non-pkg source files */
var source_files = context.get_source_files ();
foreach (SourceFile file in source_files) {
- if (file.file_type == SourceFileType.SOURCE ||
- (context.header_filename != null && file.file_type == SourceFileType.FAST)) {
- /* clear wrapper cache for every file */
- wrapper_cache = new HashMap<string, CodeNode> (str_hash, str_equal);
- file.accept (this);
- }
+ /* clear wrapper cache for every file */
+ wrapper_cache = new HashMap<string, CodeNode> (str_hash, str_equal);
+ file.accept (this);
}
}
diff --git a/vala/valaelementaccess.vala b/vala/valaelementaccess.vala
index 6696336..2da421c 100644
--- a/vala/valaelementaccess.vala
+++ b/vala/valaelementaccess.vala
@@ -76,7 +76,7 @@ public class Vala.ElementAccess : Expression {
}
public override string to_string () {
- var s = "%s[";
+ var s = "%s[".printf (container.to_string ());
bool first = true;
foreach (var index in indices) {
if (first) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]