[vala/wip/transform: 177/253] Resolve symbols during transformation
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/transform: 177/253] Resolve symbols during transformation
- Date: Sun, 18 Feb 2018 19:38:37 +0000 (UTC)
commit 9fcfba3700a6aab719d66fe028edd8f6f849cdc8
Author: Luca Bruno <lucabru src gnome org>
Date: Tue Jan 3 12:37:00 2012 +0100
Resolve symbols during transformation
codegen/valagvarianttransformer.vala | 5 ++++-
vala/valacodetransformer.vala | 1 +
vala/valaparser.vala | 6 ++++++
vala/valasymbolresolver.vala | 2 +-
4 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valagvarianttransformer.vala b/codegen/valagvarianttransformer.vala
index 735779e..4ccd767 100644
--- a/codegen/valagvarianttransformer.vala
+++ b/codegen/valagvarianttransformer.vala
@@ -268,6 +268,9 @@ public class Vala.GVariantTransformer : CodeTransformer {
b.add_expression (call);
}
b.add_return (expression (@"$builder.end ()"));
+
+ b.pop_method ();
+ check (m);
}
var call = (MethodCall) expression (m.name+"()");
@@ -284,7 +287,7 @@ public class Vala.GVariantTransformer : CodeTransformer {
var builderinit = expression (@"new GLib.VariantBuilder (new GLib.VariantType
(\"$(get_type_signature (type))\"))");
var builder = b.add_temp_declaration (null, builderinit);
- var for_each = expression (@"ht.for_each ((k,v) => $builder.add (\"{?*}\", k, v))");
+ var for_each = expression (@"ht.for_each ((k,v) => { GLib.Variant k1 = k;
GLib.Variant v1 = v; $builder.add (\"{?*}\", k, v); })");
b.add_expression (for_each);
b.add_return (expression (@"$builder.end ()"));
diff --git a/vala/valacodetransformer.vala b/vala/valacodetransformer.vala
index 8583c10..b10416a 100644
--- a/vala/valacodetransformer.vala
+++ b/vala/valacodetransformer.vala
@@ -45,6 +45,7 @@ public class Vala.CodeTransformer : CodeVisitor {
}
public void check (CodeNode node) {
+ node.accept (context.resolver);
if (!node.check (context)) {
return;
}
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index ea074af..c2d7711 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -390,6 +390,12 @@ public class Vala.Parser : CodeVisitor {
}
void skip_symbol_name () throws ParseError {
+ if (compiler_code && accept (TokenType.DOT)) {
+ // temporary variable
+ next ();
+ next ();
+ accept (TokenType.DOT);
+ }
do {
skip_identifier ();
} while (accept (TokenType.DOT) || accept (TokenType.DOUBLE_COLON));
diff --git a/vala/valasymbolresolver.vala b/vala/valasymbolresolver.vala
index 8b7f75c..28a192e 100644
--- a/vala/valasymbolresolver.vala
+++ b/vala/valasymbolresolver.vala
@@ -46,7 +46,7 @@ public class Vala.SymbolResolver : CodeVisitor {
root_symbol = null;
this.context = null;
}
-
+
public override void visit_namespace (Namespace ns) {
var old_scope = current_scope;
current_scope = ns.scope;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]