[vala] GRegex is available only in the GObject profile



commit a722c9be20cdbb61adafbe61c5f2c7653675bd8d
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Fri Apr 9 21:42:17 2010 +0200

    GRegex is available only in the GObject profile
    
    Fixes bug 615321.

 codegen/valaccodebasemodule.vala |    4 ++--
 vala/valasemanticanalyzer.vala   |    3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index f5c8381..b0ba61a 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -315,8 +315,6 @@ public class Vala.CCodeBaseModule : CCodeModule {
 		float_type = new FloatingType ((Struct) root_symbol.scope.lookup ("float"));
 		double_type = new FloatingType ((Struct) root_symbol.scope.lookup ("double"));
 		string_type = new ObjectType ((Class) root_symbol.scope.lookup ("string"));
-		regex_type = new ObjectType ((Class) root_symbol.scope.lookup ("GLib").scope.lookup ("Regex"));
-
 		var unichar_struct = (Struct) root_symbol.scope.lookup ("unichar");
 		if (unichar_struct != null) {
 			unichar_type = new IntegerType (unichar_struct);
@@ -344,6 +342,8 @@ public class Vala.CCodeBaseModule : CCodeModule {
 
 			type_module_type = (TypeSymbol) glib_ns.scope.lookup ("TypeModule");
 
+			regex_type = new ObjectType ((Class) root_symbol.scope.lookup ("GLib").scope.lookup ("Regex"));
+
 			if (context.module_init_method != null) {
 				foreach (FormalParameter parameter in context.module_init_method.get_parameters ()) {
 					if (parameter.parameter_type.data_type == type_module_type) {
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index 54e6ced..5f1625d 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -177,8 +177,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
 
 		bool_type = new BooleanType ((Struct) root_symbol.scope.lookup ("bool"));
 		string_type = new ObjectType ((Class) root_symbol.scope.lookup ("string"));
-		regex_type = new ObjectType ((Class) root_symbol.scope.lookup ("GLib").scope.lookup ("Regex"));
-
 		short_type = new IntegerType ((Struct) root_symbol.scope.lookup ("short"));
 		ushort_type = new IntegerType ((Struct) root_symbol.scope.lookup ("ushort"));
 		int_type = new IntegerType ((Struct) root_symbol.scope.lookup ("int"));
@@ -218,6 +216,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
 			gvaluearray_type = new ObjectType ((Class) glib_ns.scope.lookup ("ValueArray"));
 
 			gerror_type = (Class) glib_ns.scope.lookup ("Error");
+			regex_type = new ObjectType ((Class) root_symbol.scope.lookup ("GLib").scope.lookup ("Regex"));
 		} else if (context.profile == Profile.DOVA) {
 			var dova_ns = root_symbol.scope.lookup ("Dova");
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]