Commit ffb3d21f authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

remove obsolete ref modifier and callback keyword

2007-07-09  Juerg Billeter  <j@bitron.ch>

	* vala/scanner.l, vala/parser.y, vala/valaarray.vala,
	  vala/valaarraycreationexpression.vala, vala/valaattribute.vala,
	  vala/valabaseaccess.vala, vala/valablock.vala,
	  vala/valabooleanliteral.vala, vala/valacallback.vala,
	  vala/valaclass.vala, vala/valacodecontext.vala,
	  vala/valacodenode.vala, vala/valacreationmethod.vala,
	  vala/valadatatype.vala, vala/valaelementaccess.vala,
	  vala/valaenum.vala, vala/valafield.vala, vala/valaflags.vala,
	  vala/valaformalparameter.vala, vala/valaforstatement.vala,
	  vala/valainitializerlist.vala, vala/valaintegerliteral.vala,
	  vala/valainterface.vala, vala/valainterfacewriter.vala,
	  vala/valainvocationexpression.vala, vala/valainvokable.vala,
	  vala/valalambdaexpression.vala, vala/valaliteralexpression.vala,
	  vala/valalocalvariabledeclaration.vala, vala/valamemberaccess.vala,
	  vala/valamemorymanager.vala, vala/valamethod.vala,
	  vala/valanamespace.vala, vala/valanullliteral.vala,
	  vala/valaobjectcreationexpression.vala, vala/valaparser.vala,
	  vala/valapointer.vala, vala/valaproperty.vala,
	  vala/valasemanticanalyzer.vala, vala/valasignal.vala,
	  vala/valasourcefile.vala, vala/valasourcereference.vala,
	  vala/valastringliteral.vala, vala/valastruct.vala,
	  vala/valaswitchsection.vala, vala/valaswitchstatement.vala,
	  vala/valasymbol.vala, vala/valasymbolresolver.vala,
	  vala/valatypereference.vala, vala/valavariabledeclarator.vala,
	  gobject/valaclassregisterfunction.vala,
	  gobject/valacodegenerator.vala,
	  gobject/valacodegeneratorassignment.vala,
	  gobject/valacodegeneratorclass.vala,
	  gobject/valacodegeneratorinterface.vala,
	  gobject/valacodegeneratorinvocationexpression.vala,
	  gobject/valacodegeneratormemberaccess.vala,
	  gobject/valacodegeneratormethod.vala,
	  gobject/valacodegeneratorsignal.vala,
	  gobject/valacodegeneratorsourcefile.vala,
	  gobject/valainterfaceregisterfunction.vala,
	  gobject/valatyperegisterfunction.vala, ccode/valaccodefragment.vala,
	  ccode/valaccodefunction.vala, compiler/valacompiler.vala,
	  vapi/cairo.vala, vapi/glib-2.0.vala, vapi/libxml-2.0.vala,
	  tests/test-023.vala, gobject-introspection/gidl.vala,
	  vapigen/valagidlparser.vala, vapigen/valavapigen.vala: remove obsolete
	  ref modifier and callback keyword

svn path=/trunk/; revision=334
parent 0ab8f98f
2007-07-09 Jürg Billeter <j@bitron.ch>
* vala/scanner.l, vala/parser.y, vala/valaarray.vala,
vala/valaarraycreationexpression.vala, vala/valaattribute.vala,
vala/valabaseaccess.vala, vala/valablock.vala,
vala/valabooleanliteral.vala, vala/valacallback.vala,
vala/valaclass.vala, vala/valacodecontext.vala,
vala/valacodenode.vala, vala/valacreationmethod.vala,
vala/valadatatype.vala, vala/valaelementaccess.vala,
vala/valaenum.vala, vala/valafield.vala, vala/valaflags.vala,
vala/valaformalparameter.vala, vala/valaforstatement.vala,
vala/valainitializerlist.vala, vala/valaintegerliteral.vala,
vala/valainterface.vala, vala/valainterfacewriter.vala,
vala/valainvocationexpression.vala, vala/valainvokable.vala,
vala/valalambdaexpression.vala, vala/valaliteralexpression.vala,
vala/valalocalvariabledeclaration.vala, vala/valamemberaccess.vala,
vala/valamemorymanager.vala, vala/valamethod.vala,
vala/valanamespace.vala, vala/valanullliteral.vala,
vala/valaobjectcreationexpression.vala, vala/valaparser.vala,
vala/valapointer.vala, vala/valaproperty.vala,
vala/valasemanticanalyzer.vala, vala/valasignal.vala,
vala/valasourcefile.vala, vala/valasourcereference.vala,
vala/valastringliteral.vala, vala/valastruct.vala,
vala/valaswitchsection.vala, vala/valaswitchstatement.vala,
vala/valasymbol.vala, vala/valasymbolresolver.vala,
vala/valatypereference.vala, vala/valavariabledeclarator.vala,
gobject/valaclassregisterfunction.vala,
gobject/valacodegenerator.vala,
gobject/valacodegeneratorassignment.vala,
gobject/valacodegeneratorclass.vala,
gobject/valacodegeneratorinterface.vala,
gobject/valacodegeneratorinvocationexpression.vala,
gobject/valacodegeneratormemberaccess.vala,
gobject/valacodegeneratormethod.vala,
gobject/valacodegeneratorsignal.vala,
gobject/valacodegeneratorsourcefile.vala,
gobject/valainterfaceregisterfunction.vala,
gobject/valatyperegisterfunction.vala, ccode/valaccodefragment.vala,
ccode/valaccodefunction.vala, compiler/valacompiler.vala,
vapi/cairo.vala, vapi/glib-2.0.vala, vapi/libxml-2.0.vala,
tests/test-023.vala, gobject-introspection/gidl.vala,
vapigen/valagidlparser.vala, vapigen/valavapigen.vala: remove obsolete
ref modifier and callback keyword
2007-07-09 Jürg Billeter <j@bitron.ch>
* vala/valainterfacewriter.vala: write static delegate instead of
......
......@@ -42,7 +42,7 @@ public class Vala.CCodeFragment : CCodeNode {
*
* @return children list
*/
public ref List<weak CCodeNode> get_children () {
public List<weak CCodeNode> get_children () {
return children.copy ();
}
......
/* valaccodefunction.vala
*
* Copyright (C) 2006 Jürg Billeter
* Copyright (C) 2006-2007 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -67,7 +67,7 @@ public class Vala.CCodeFunction : CCodeNode {
*
* @return copied function
*/
public ref CCodeFunction! copy () {
public CCodeFunction! copy () {
var func = new CCodeFunction (name, return_type);
func.modifiers = modifiers;
......
......@@ -72,7 +72,7 @@ class Vala.Compiler {
}
}
private ref string get_package_path (string! pkg) {
private string get_package_path (string! pkg) {
string basename = "%s.vala".printf (pkg);
if (vapi_directories != null) {
......@@ -121,7 +121,8 @@ class Vala.Compiler {
var deps_filename = Path.build_filename (Path.get_dirname (package_path), "%s.deps".printf (pkg));
if (FileUtils.test (deps_filename, FileTest.EXISTS)) {
string deps_content;
FileUtils.get_contents (deps_filename, out deps_content, null, null);
long deps_len;
FileUtils.get_contents (deps_filename, out deps_content, out deps_len, null);
foreach (string dep in deps_content.split ("\n")) {
if (dep != "") {
if (!add_package (context, dep)) {
......
/* gidl.vala
*
* Copyright (C) 2006 Jürg Billeter
* Copyright (C) 2006-2007 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -24,7 +24,7 @@
namespace GLib {
[CCode (cheader_filename = "gidlparser.h")]
public struct Idl {
public static ref List<IdlModule> parse_file (string! filename, out Error error);
public static List<IdlModule> parse_file (string! filename, out Error error);
}
[CCode (cheader_filename = "gidlmodule.h")]
......
......@@ -45,27 +45,27 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
return class_reference;
}
public override ref string! get_type_struct_name () {
public override string! get_type_struct_name () {
return "%sClass".printf (class_reference.get_cname ());
}
public override ref string! get_base_init_func_name () {
public override string! get_base_init_func_name () {
return "NULL";
}
public override ref string! get_class_init_func_name () {
public override string! get_class_init_func_name () {
return "%s_class_init".printf (class_reference.get_lower_case_cname (null));
}
public override ref string! get_instance_struct_size () {
public override string! get_instance_struct_size () {
return "sizeof (%s)".printf (class_reference.get_cname ());
}
public override ref string! get_instance_init_func_name () {
public override string! get_instance_init_func_name () {
return "%s_init".printf (class_reference.get_lower_case_cname (null));
}
public override ref string! get_parent_type_name () {
public override string! get_parent_type_name () {
return class_reference.base_class.get_upper_case_cname ("TYPE_");
}
......@@ -77,7 +77,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
}
}
public override ref CCodeFragment! get_type_interface_init_declaration () {
public override CCodeFragment! get_type_interface_init_declaration () {
var frag = new CCodeFragment ();
foreach (TypeReference base_type in class_reference.get_base_types ()) {
......@@ -98,7 +98,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction {
return frag;
}
public override ref CCodeFragment! get_type_interface_init_statements () {
public override CCodeFragment! get_type_interface_init_statements () {
var frag = new CCodeFragment ();
foreach (TypeReference base_type in class_reference.get_base_types ()) {
......
......@@ -821,10 +821,10 @@ public class Vala.CodeGenerator : CodeVisitor {
}
}
private ref VariableDeclarator get_temp_variable_declarator (TypeReference! type, bool takes_ownership = true) {
private VariableDeclarator get_temp_variable_declarator (TypeReference! type, bool takes_ownership = true) {
var decl = new VariableDeclarator ("__temp%d".printf (next_temp_var_id));
decl.type_reference = type.copy ();
decl.type_reference.reference_to_value_type = false;
decl.type_reference.is_ref = false;
decl.type_reference.is_out = false;
decl.type_reference.takes_ownership = takes_ownership;
......@@ -850,7 +850,7 @@ public class Vala.CodeGenerator : CodeVisitor {
}
}
private ref CCodeExpression get_unref_expression (CCodeExpression! cvar, TypeReference! type) {
private CCodeExpression get_unref_expression (CCodeExpression! cvar, TypeReference! type) {
/* (foo == NULL ? NULL : foo = (unref (foo), NULL)) */
/* can be simplified to
......@@ -1060,7 +1060,7 @@ public class Vala.CodeGenerator : CodeVisitor {
List<weak Statement> default_statements = null;
// generate nested if statements
ref CCodeStatement ctopstmt = null;
CCodeStatement ctopstmt = null;
CCodeIfStatement coldif = null;
foreach (SwitchSection section in stmt.get_sections ()) {
if (section.has_default_label ()) {
......@@ -1419,7 +1419,7 @@ public class Vala.CodeGenerator : CodeVisitor {
}
}
private ref string get_symbol_lock_name (Symbol! sym) {
private string get_symbol_lock_name (Symbol! sym) {
return "__lock_%s".printf (sym.name);
}
......@@ -1539,7 +1539,7 @@ public class Vala.CodeGenerator : CodeVisitor {
visit_expression (expr);
}
private ref CCodeExpression! get_array_length_cexpression (Expression! array_expr, int dim) {
private CCodeExpression! get_array_length_cexpression (Expression! array_expr, int dim) {
bool is_out = false;
if (array_expr is UnaryExpression) {
......@@ -1604,7 +1604,7 @@ public class Vala.CodeGenerator : CodeVisitor {
}
if (field.instance) {
ref CCodeExpression typed_inst;
CCodeExpression typed_inst;
if (field.symbol.parent_symbol.node != base_type) {
// FIXME: use C cast if debugging disabled
typed_inst = new CCodeFunctionCall (new CCodeIdentifier (((DataType) field.symbol.parent_symbol.node).get_upper_case_cname (null)));
......@@ -1612,7 +1612,7 @@ public class Vala.CodeGenerator : CodeVisitor {
} else {
typed_inst = pub_inst;
}
ref CCodeExpression inst;
CCodeExpression inst;
if (field.access == MemberAccessibility.PRIVATE) {
inst = new CCodeMemberAccess.pointer (typed_inst, "priv");
} else {
......@@ -1721,7 +1721,7 @@ public class Vala.CodeGenerator : CodeVisitor {
return null;
}
private ref CCodeExpression get_ref_expression (Expression! expr) {
private CCodeExpression get_ref_expression (Expression! expr) {
/* (temp = expr, temp == NULL ? NULL : ref (temp))
*
* can be simplified to
......@@ -1865,7 +1865,7 @@ public class Vala.CodeGenerator : CodeVisitor {
/* explicitly use strong reference as ccall gets
* unrefed at end of inner block
*/
ref CCodeExpression cexpr = (CCodeExpression) arg.ccodenode;
CCodeExpression cexpr = (CCodeExpression) arg.ccodenode;
if (params_it != null) {
var param = (FormalParameter) params_it.data;
ellipsis = param.ellipsis;
......
......@@ -63,7 +63,7 @@ public class Vala.CodeGenerator {
a.ccodenode = ccomma;
} else {
ref CCodeExpression cexpr = (CCodeExpression) a.right.ccodenode;
CCodeExpression cexpr = (CCodeExpression) a.right.ccodenode;
if (!prop.no_accessor_method
&& prop.type_reference.data_type != null
......@@ -191,7 +191,7 @@ public class Vala.CodeGenerator {
/* explicitly use strong reference as ccast gets
* unrefed at end of inner block
*/
ref CCodeExpression rhs = (CCodeExpression) a.right.ccodenode;
CCodeExpression rhs = (CCodeExpression) a.right.ccodenode;
if (a.left.static_type.data_type != null
&& a.right.static_type.data_type != null
......@@ -257,7 +257,7 @@ public class Vala.CodeGenerator {
}
}
private ref CCodeFunctionCall get_property_set_call (Property! prop, MemberAccess! ma, CCodeExpression! cexpr) {
private CCodeFunctionCall get_property_set_call (Property! prop, MemberAccess! ma, CCodeExpression! cexpr) {
var cl = (Class) prop.symbol.parent_symbol.node;
var set_func = "g_object_set";
......@@ -275,7 +275,7 @@ public class Vala.CodeGenerator {
var ccall = new CCodeFunctionCall (new CCodeIdentifier (set_func));
/* target instance is first argument */
ref CCodeExpression instance;
CCodeExpression instance;
var req_cast = false;
if (ma.inner == null) {
......
......@@ -134,7 +134,7 @@ public class Vala.CodeGenerator {
var init_block = new CCodeBlock ();
class_init.block = init_block;
ref CCodeFunctionCall ccall;
CCodeFunctionCall ccall;
/* save pointer to parent class */
var parent_decl = new CCodeDeclaration ("gpointer");
......@@ -249,7 +249,7 @@ public class Vala.CodeGenerator {
var init_block = new CCodeBlock ();
iface_init.block = init_block;
ref CCodeFunctionCall ccall;
CCodeFunctionCall ccall;
/* save pointer to parent vtable */
string parent_iface_var = "%s_%s_parent_iface".printf (cl.get_lower_case_cname (null), iface.get_lower_case_cname (null));
......@@ -360,7 +360,7 @@ public class Vala.CodeGenerator {
source_type_member_definition.append (function);
}
private ref CCodeIdentifier! get_value_setter_function (TypeReference! type_reference) {
private CCodeIdentifier! get_value_setter_function (TypeReference! type_reference) {
if (type_reference.data_type is Class || type_reference.data_type is Interface) {
return new CCodeIdentifier ("g_value_set_object");
} else if (type_reference.data_type == string_type.data_type) {
......
......@@ -73,7 +73,7 @@ public class Vala.CodeGenerator {
current_type_symbol = null;
}
private ref CCodeFunctionCall! get_param_spec (Property! prop) {
private CCodeFunctionCall! get_param_spec (Property! prop) {
var cspec = new CCodeFunctionCall ();
cspec.add_argument (prop.get_canonical_cconstant ());
cspec.add_argument (new CCodeConstant ("\"foo\""));
......@@ -141,7 +141,7 @@ public class Vala.CodeGenerator {
return cspec;
}
private ref CCodeFunctionCall! get_signal_creation (Signal! sig, DataType! type) {
private CCodeFunctionCall! get_signal_creation (Signal! sig, DataType! type) {
var csignew = new CCodeFunctionCall (new CCodeIdentifier ("g_signal_new"));
csignew.add_argument (new CCodeConstant ("\"%s\"".printf (sig.name)));
csignew.add_argument (new CCodeIdentifier (type.get_upper_case_cname ("TYPE_")));
......
......@@ -57,7 +57,7 @@ public class Vala.CodeGenerator {
/* explicitly use strong reference as ccall gets unrefed
* at end of inner block
*/
ref CCodeExpression instance;
CCodeExpression instance;
if (m != null && m.instance) {
var base_method = m;
if (m.base_interface_method != null) {
......@@ -102,7 +102,7 @@ public class Vala.CodeGenerator {
/* explicitly use strong reference as ccall gets
* unrefed at end of inner block
*/
ref CCodeExpression cexpr = (CCodeExpression) arg.ccodenode;
CCodeExpression cexpr = (CCodeExpression) arg.ccodenode;
if (params_it != null) {
var param = (FormalParameter) params_it.data;
ellipsis = param.ellipsis;
......
......@@ -57,7 +57,7 @@ public class Vala.CodeGenerator {
} else if (expr.symbol_reference.node is Field) {
var f = (Field) expr.symbol_reference.node;
if (f.instance) {
ref CCodeExpression typed_inst;
CCodeExpression typed_inst;
if (f.symbol.parent_symbol.node != base_type) {
// FIXME: use C cast if debugging disabled
typed_inst = new CCodeFunctionCall (new CCodeIdentifier (((DataType) f.symbol.parent_symbol.node).get_upper_case_cname (null)));
......@@ -65,7 +65,7 @@ public class Vala.CodeGenerator {
} else {
typed_inst = pub_inst;
}
ref CCodeExpression inst;
CCodeExpression inst;
if (f.access == MemberAccessibility.PRIVATE) {
inst = new CCodeMemberAccess.pointer (typed_inst, "priv");
} else {
......@@ -144,7 +144,7 @@ public class Vala.CodeGenerator {
if (p.name == "this") {
expr.ccodenode = pub_inst;
} else {
if (p.type_reference.is_out || p.type_reference.reference_to_value_type) {
if (p.type_reference.is_out || p.type_reference.is_ref) {
expr.ccodenode = new CCodeIdentifier ("(*%s)".printf (p.name));
} else {
expr.ccodenode = new CCodeIdentifier (p.name);
......@@ -160,7 +160,7 @@ public class Vala.CodeGenerator {
/* explicitly use strong reference as ccast
* gets unrefed at the end of the inner block
*/
ref CCodeExpression typed_pub_inst = pub_inst;
CCodeExpression typed_pub_inst = pub_inst;
/* cast if necessary */
if (cl != base_type) {
......
......@@ -329,11 +329,11 @@ public class Vala.CodeGenerator {
}
}
private ref CCodeStatement create_method_type_check_statement (Method! m, DataType! t, bool non_null, string! var_name) {
private CCodeStatement create_method_type_check_statement (Method! m, DataType! t, bool non_null, string! var_name) {
return create_type_check_statement (m, m.return_type.data_type, t, non_null, var_name);
}
private ref CCodeStatement create_property_type_check_statement (Property! prop, bool getter, DataType! t, bool non_null, string! var_name) {
private CCodeStatement create_property_type_check_statement (Property! prop, bool getter, DataType! t, bool non_null, string! var_name) {
if (getter) {
return create_type_check_statement (prop, prop.type_reference.data_type, t, non_null, var_name);
} else {
......@@ -341,14 +341,14 @@ public class Vala.CodeGenerator {
}
}
private ref CCodeStatement create_type_check_statement (CodeNode! method_node, DataType ret_type, DataType! t, bool non_null, string! var_name) {
private CCodeStatement create_type_check_statement (CodeNode! method_node, DataType ret_type, DataType! t, bool non_null, string! var_name) {
var ccheck = new CCodeFunctionCall ();
if (t is Class || t is Interface) {
var ctype_check = new CCodeFunctionCall (new CCodeIdentifier (t.get_upper_case_cname ("IS_")));
ctype_check.add_argument (new CCodeIdentifier (var_name));
ref CCodeExpression cexpr = ctype_check;
CCodeExpression cexpr = ctype_check;
if (!non_null) {
var cnull = new CCodeBinaryExpression (CCodeBinaryOperator.EQUALITY, new CCodeIdentifier (var_name), new CCodeConstant ("NULL"));
......@@ -392,7 +392,7 @@ public class Vala.CodeGenerator {
return null;
}
private ref string! get_array_length_cname (string! array_cname, int dim) {
private string! get_array_length_cname (string! array_cname, int dim) {
return "%s_length%d".printf (array_cname, dim);
}
......
......@@ -34,7 +34,7 @@ public class Vala.CodeGenerator {
}
}
private ref string get_signal_marshaller_function (Signal! sig, string prefix = null) {
private string get_signal_marshaller_function (Signal! sig, string prefix = null) {
var signature = get_signal_signature (sig);
string ret;
var params = sig.get_parameters ();
......@@ -85,7 +85,7 @@ public class Vala.CodeGenerator {
return null;
}
private ref string get_signal_signature (Signal! sig) {
private string get_signal_signature (Signal! sig) {
string signature;
var params = sig.get_parameters ();
......
......@@ -24,7 +24,7 @@
using GLib;
public class Vala.CodeGenerator {
private ref CCodeIncludeDirective get_internal_include (string! filename) {
private CCodeIncludeDirective get_internal_include (string! filename) {
return new CCodeIncludeDirective (filename, context.library == null);
}
......@@ -50,7 +50,7 @@ public class Vala.CodeGenerator {
header_begin.append (new CCodeIncludeDirective ("glib-object.h"));
source_include_directives.append (new CCodeIncludeDirective (source_file.get_cheader_filename (), true));
ref List<weak string> used_includes = null;
List<weak string> used_includes = null;
used_includes.append ("glib.h");
used_includes.append ("glib-object.h");
used_includes.append (source_file.get_cheader_filename ());
......@@ -175,7 +175,7 @@ public class Vala.CodeGenerator {
source_signal_marshaller_declaration = null;
}
private static ref string get_define_for_filename (string! filename) {
private static string get_define_for_filename (string! filename) {
var define = new String ("__");
var i = filename;
......
......@@ -40,31 +40,31 @@ public class Vala.InterfaceRegisterFunction : TypeRegisterFunction {
return interface_reference;
}
public override ref string! get_type_struct_name () {
public override string! get_type_struct_name () {
return interface_reference.get_type_cname ();
}
public override ref string! get_base_init_func_name () {
public override string! get_base_init_func_name () {
return "%s_base_init".printf (interface_reference.get_lower_case_cname (null));
}
public override ref string! get_class_init_func_name () {
public override string! get_class_init_func_name () {
return "NULL";
}
public override ref string! get_instance_struct_size () {
public override string! get_instance_struct_size () {
return "0";
}
public override ref string! get_instance_init_func_name () {
public override string! get_instance_init_func_name () {
return "NULL";
}
public override ref string! get_parent_type_name () {
public override string! get_parent_type_name () {
return "G_TYPE_INTERFACE";
}
public override ref CCodeFragment! get_type_interface_init_statements () {
public override CCodeFragment! get_type_interface_init_statements () {
var frag = new CCodeFragment ();
/* register all prerequisites */
......
......@@ -116,42 +116,42 @@ public abstract class Vala.TypeRegisterFunction {
*
* @return C struct name
*/
public abstract ref string! get_type_struct_name ();
public abstract string! get_type_struct_name ();
/**
* Returns the name of the base_init function in C code.
*
* @return C function name
*/
public abstract ref string! get_base_init_func_name ();
public abstract string! get_base_init_func_name ();
/**
* Returns the name of the class_init function in C code.
*
* @return C function name
*/
public abstract ref string! get_class_init_func_name ();
public abstract string! get_class_init_func_name ();
/**
* Returns the size of the instance struct in C code.
*
* @return C instance struct size
*/
public abstract ref string! get_instance_struct_size ();
public abstract string! get_instance_struct_size ();
/**
* Returns the name of the instance_init function in C code.
*
* @return C function name
*/
public abstract ref string! get_instance_init_func_name ();
public abstract string! get_instance_init_func_name ();
/**
* Returns the name of the parent type in C code.
*
* @return C parent type name
*/
public abstract ref string! get_parent_type_name ();
public abstract string! get_parent_type_name ();
/**
* Returns the set of type flags to be applied when registering.
......@@ -167,7 +167,7 @@ public abstract class Vala.TypeRegisterFunction {
*
* @return C declarations
*/
public virtual ref CCodeFragment! get_type_interface_init_declaration () {
public virtual CCodeFragment! get_type_interface_init_declaration () {
return new CCodeFragment ();
}
......@@ -176,7 +176,7 @@ public abstract class Vala.TypeRegisterFunction {
*
* @return C statements
*/
public abstract ref CCodeFragment! get_type_interface_init_statements ();
public abstract CCodeFragment! get_type_interface_init_statements ();
/**
* Returns the declaration for this type register function in C code.
......
......@@ -7,7 +7,7 @@ class Maman.Foo {
}
}
public ref List<string> create_list () {
public List<string> create_list () {
var s = new List<string>();
s.append ("2");
......
......@@ -154,7 +154,6 @@ static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
%token ABSTRACT "abstract"
%token BASE "base"
%token BREAK "break"
%token CALLBACK "callback"
%token CASE "case"
%token CATCH "catch"
%token CLASS "class"
......@@ -510,10 +509,19 @@ type
vala_type_reference_set_non_null ($$, TRUE);
}
}
| WEAK type_name opt_rank_specifier opt_op_neg
{
$$ = $2;
vala_type_reference_set_is_weak ($$, TRUE);
vala_type_reference_set_array_rank ($$, $3);
if ($4) {
vala_type_reference_set_non_null ($$, TRUE);
}
}
| type_name opt_rank_specifier opt_op_neg HASH
{
$$ = $1;
vala_type_reference_set_is_ref ($$, TRUE);
vala_type_reference_set_takes_ownership ($$, TRUE);
vala_type_reference_set_array_rank ($$, $2);
if ($3) {
vala_type_reference_set_non_null ($$, TRUE);
......@@ -528,15 +536,6 @@ type
vala_type_reference_set_non_null ($$, TRUE);
}
}
| WEAK type_name opt_rank_specifier opt_op_neg
{
$$ = $2;
vala_type_reference_set_is_weak ($$, TRUE);
vala_type_reference_set_array_rank ($$, $3);
if ($4) {
vala_type_reference_set_non_null ($$, TRUE);
}
}
| OUT type_name opt_rank_specifier opt_op_neg
{
$$ = $2;
......@@ -546,10 +545,10 @@ type
vala_type_reference_set_non_null ($$, TRUE);
}
}
| OUT REF type_name opt_rank_specifier opt_op_neg
| OUT WEAK type_name opt_rank_specifier opt_op_neg
{
$$ = $3;
vala_type_reference_set_is_ref ($$, TRUE);
vala_type_reference_set_is_weak ($$, TRUE);
vala_type_reference_set_is_out ($$, TRUE);
vala_type_reference_set_array_rank ($$, $4);
if ($5) {
......@@ -1529,18 +1528,6 @@ local_variable_type
g_object_unref (src);
vala_type_reference_set_pointer_level ($$, $2);
}
| REF primary_expression opt_bracket_pair opt_op_neg
{
ValaSourceReference *src = src(@2);
$$ = vala_type_reference_new_from_expression ($2);
g_object_unref ($2);
g_object_unref (src);
vala_type_reference_set_takes_ownership ($$, TRUE);
vala_type_reference_set_array_rank ($$, $3);
if ($4) {
vala_type_reference_set_non_null ($$, TRUE);
}
}
| WEAK primary_expression opt_bracket_pair opt_op_neg
{
ValaSourceReference *src = src(@2);
......@@ -2481,12 +2468,15 @@ field_declaration
{
ValaSourceReference *src;
src = src_com(@5, $1);
if (vala_type_reference_get_is_ref ($5) || vala_type_reference_get_is_out ($5)) {
vala_report_error (src, "`ref' and `out' may only be used for parameters.");
}
if (!vala_type_reference_get_is_weak ($5)) {
vala_type_reference_set_takes_ownership ($5, TRUE);
}
vala_type_reference_set_is_ref ($5, FALSE);
src = src_com(@5, $1);
$$ = vala_field_new (vala_variable_declarator_get_name ($6), $5, vala_variable_declarator_get_initializer ($6), src);
g_object_unref (src);
if ($3 != 0) {
......@@ -2599,12 +2589,16 @@ method_header
GList *l;
ValaSourceReference *src;
ValaModifier vmodifiers;
src = src_com(@6, $1);
if (vala_type_reference_get_is_ref ($5) || vala_type_reference_get_is_out ($5)) {
vala_report_error (src, "`ref' and `out' may only be used for parameters.");
}
if (!vala_type_reference_get_is_weak ($5)) {
vala_type_reference_set_transfers_ownership ($5, TRUE);
}
src = src_com(@6, $1);
$$ = vala_method_new ($6, $5, src);
g_object_unref (src);
if ($3 != 0) {
......@@ -2722,11 +2716,6 @@ fixed_parameter
{
ValaSourceReference *src;
if (vala_type_reference_get_is_ref ($3) && vala_type_reference_get_is_out ($3)) {
vala_type_reference_set_takes_ownership ($3, TRUE);
vala_type_reference_set_is_ref ($3, FALSE);
}
src = src(@3);
$$ = vala_formal_parameter_new ($4, $3, src);
g_object_unref (src);
......@@ -2738,11 +2727,6 @@ fixed_parameter
{
ValaSourceReference *src;
if (vala_type_reference_get_is_ref ($3) && vala_type_reference_get_is_out ($3)) {
vala_type_reference_set_takes_ownership ($3, TRUE);
vala_type_reference_set_is_ref ($3, FALSE);