} else {
return "G_TYPE_POINTER";
}
- } else if (node is ArrayType && ((ArrayType) node).element_type.type_symbol.get_full_name () == "string") {
+ } else if (node is ArrayType && ((ArrayType) node).element_type.type_symbol == CodeContext.get ().analyzer.string_type.type_symbol) {
return "G_TYPE_STRV";
} else if (node is PointerType || node is DelegateType) {
return "G_TYPE_POINTER";
return "POINTER";
} else if (node is ArrayType) {
unowned ArrayType array_type = (ArrayType) node;
- if (array_type.element_type.type_symbol.get_full_name () == "string") {
+ if (array_type.element_type.type_symbol == CodeContext.get ().analyzer.string_type.type_symbol) {
return "BOXED,%s".printf (get_ccode_marshaller_type_name (array_type.length_type.type_symbol));
} else {
var ret = "POINTER";
return "g_param_spec_boxed";
}
}
- } else if (node is ArrayType && ((ArrayType)node).element_type.type_symbol == CodeContext.get().analyzer.string_type.type_symbol) {
+ } else if (node is ArrayType && ((ArrayType) node).element_type.type_symbol == CodeContext.get ().analyzer.string_type.type_symbol) {
return "g_param_spec_boxed";
} else if (node is DataType && ((DataType) node).type_symbol != null) {
return get_ccode_param_spec_function (((DataType) node).type_symbol);
var context = CodeContext.get ();
if (context.profile == Profile.GOBJECT && target_type.type_symbol != null) {
- if (target_type.type_symbol.is_subtype_of (context.analyzer.gvalue_type.type_symbol) && element_type.type_symbol == context.root.scope.lookup ("string")) {
+ if (target_type.type_symbol.is_subtype_of (context.analyzer.gvalue_type.type_symbol) && element_type.type_symbol == context.analyzer.string_type.type_symbol) {
// allow implicit conversion from string[] to GValue
return true;
}
checked = true;
if (get_char () < 128) {
- value_type = new IntegerType ((Struct) context.root.scope.lookup ("char"));
+ value_type = context.analyzer.char_type.copy ();
} else {
- value_type = new IntegerType ((Struct) context.root.scope.lookup ("unichar"));
+ value_type = context.analyzer.unichar_type.copy ();
}
return !error;
public unowned Method get_to_string_method () {
if (to_string_method == null) {
- var string_type = new ObjectType ((Class) CodeContext.get ().root.scope.lookup ("string"));
+ var string_type = CodeContext.get ().analyzer.string_type.copy ();
string_type.value_owned = false;
to_string_method = new Method ("to_string", string_type);
to_string_method.access = SymbolAccessibility.PUBLIC;
}
public override Symbol? get_member (string member_name) {
- var gerror_symbol = CodeContext.get ().root.scope.lookup ("GLib").scope.lookup ("Error");
- return gerror_symbol.scope.lookup (member_name);
+ return CodeContext.get ().analyzer.gerror_type.scope.lookup (member_name);
}
public override bool is_reference_type_or_type_parameter () {
assert (this.coroutine);
if (callback_method == null) {
- var bool_type = new BooleanType ((Struct) CodeContext.get ().root.scope.lookup ("bool"));
+ var bool_type = CodeContext.get ().analyzer.bool_type.copy ();
bool_type.value_owned = true;
callback_method = new Method ("callback", bool_type, source_reference);
callback_method.access = SymbolAccessibility.PUBLIC;
unowned Method get_connect_method () {
if (connect_method == null) {
- var ulong_type = new IntegerType ((Struct) CodeContext.get ().root.scope.lookup ("ulong"));
+ var ulong_type = CodeContext.get ().analyzer.ulong_type.copy ();
connect_method = new Method ("connect", ulong_type);
connect_method.access = SymbolAccessibility.PUBLIC;
connect_method.external = true;
unowned Method get_connect_after_method () {
if (connect_after_method == null) {
- var ulong_type = new IntegerType ((Struct) CodeContext.get ().root.scope.lookup ("ulong"));
+ var ulong_type = CodeContext.get ().analyzer.ulong_type.copy ();
connect_after_method = new Method ("connect_after", ulong_type);
connect_after_method.access = SymbolAccessibility.PUBLIC;
connect_after_method.external = true;