[vala/wip/transform: 117/139] 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: 117/139] Visit all nodes for transformation, not only the source ones
- Date: Mon, 17 Oct 2016 20:15:20 +0000 (UTC)
commit 2c39c2f9f8559289b9689a86fca338ee760f34f8
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 +-
vala/valamethod.vala | 2 +-
4 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index 8e28b1f..0f286fc 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 8fa8edd..23b10fd 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 d7e9b45..437c382 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) {
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 2c724e7..2e68c81 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -654,7 +654,7 @@ public class Vala.Method : Subroutine, Callable {
if (checked) {
return !error;
}
-
+
checked = true;
if (get_attribute ("DestroysInstance") != null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]