Commit 85cfd74f authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

deprecate construct as parameter modifier, fixes bug 524138

2008-04-13  Juerg Billeter  <j@bitron.ch>

	* vala/valaparser.vala: deprecate construct as parameter modifier,
	  fixes bug 524138

	* */*.vala: port to new syntax

svn path=/trunk/; revision=1209
parent 206cd671
2008-04-13 Jürg Billeter <j@bitron.ch>
* vala/valaparser.vala: deprecate construct as parameter modifier,
fixes bug 524138
* */*.vala: port to new syntax
2008-04-13 Jürg Billeter <j@bitron.ch>
* vala/valaparser.vala: report warning when using obsolete syntax
......
......@@ -34,7 +34,8 @@ public class Vala.CCodeCaseStatement : CCodeStatement {
private Gee.List<CCodeStatement> statements = new ArrayList<CCodeStatement> ();
public CCodeCaseStatement (construct CCodeExpression expression) {
public CCodeCaseStatement (CCodeExpression expression) {
this.expression = expression;
}
/**
......
......@@ -39,7 +39,8 @@ public class Vala.CCodeDeclaration : CCodeStatement {
private Gee.List<CCodeDeclarator> declarators = new ArrayList<CCodeDeclarator> ();
public CCodeDeclaration (construct string type_name) {
public CCodeDeclaration (string type_name) {
this.type_name = type_name;
}
/**
......
......@@ -34,7 +34,8 @@ public class Vala.CCodeEnum : CCodeNode {
private Gee.List<CCodeEnumValue> values = new ArrayList<CCodeEnumValue> ();
public CCodeEnum (construct string name = null) {
public CCodeEnum (string name = null) {
this.name = name;
}
/**
......
......@@ -37,7 +37,9 @@ public class Vala.CCodeEnumValue : CCodeNode {
*/
public CCodeExpression value { get; set; }
public CCodeEnumValue (construct string name, construct CCodeExpression value = null) {
public CCodeEnumValue (string name, CCodeExpression value = null) {
this.value = value;
this.name = name;
}
public override void write (CCodeWriter writer) {
......
......@@ -40,7 +40,9 @@ public class Vala.CCodeForStatement : CCodeStatement {
private Gee.List<CCodeExpression> initializer = new ArrayList<CCodeExpression> ();
private Gee.List<CCodeExpression> iterator = new ArrayList<CCodeExpression> ();
public CCodeForStatement (construct CCodeExpression condition, construct CCodeStatement body = null) {
public CCodeForStatement (CCodeExpression condition, CCodeStatement body = null) {
this.body = body;
this.condition = condition;
}
/**
......
......@@ -49,7 +49,9 @@ public class Vala.CCodeFunction : CCodeNode {
private Gee.List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
public CCodeFunction (construct string name, construct string return_type) {
public CCodeFunction (string name, string return_type) {
this.return_type = return_type;
this.name = name;
}
/**
......
......@@ -34,7 +34,8 @@ public class Vala.CCodeFunctionCall : CCodeExpression {
private Gee.List<CCodeExpression> arguments = new ArrayList<CCodeExpression> ();
public CCodeFunctionCall (construct CCodeExpression call = null) {
public CCodeFunctionCall (CCodeExpression call = null) {
this.call = call;
}
/**
......
......@@ -34,7 +34,8 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator {
private Gee.List<CCodeFormalParameter> parameters = new ArrayList<CCodeFormalParameter> ();
public CCodeFunctionDeclarator (construct string name) {
public CCodeFunctionDeclarator (string name) {
this.name = name;
}
/**
......
......@@ -31,7 +31,8 @@ public class Vala.CCodeGotoStatement : CCodeStatement {
*/
public string name { get; set construct; }
public CCodeGotoStatement (construct string name) {
public CCodeGotoStatement (string name) {
this.name = name;
}
public override void write (CCodeWriter writer) {
......
......@@ -31,7 +31,8 @@ public class Vala.CCodeLabel : CCodeStatement {
*/
public string name { get; set construct; }
public CCodeLabel (construct string name) {
public CCodeLabel (string name) {
this.name = name;
}
public override void write (CCodeWriter writer) {
......
......@@ -41,10 +41,14 @@ public class Vala.CCodeMacroReplacement : CCodeNode {
*/
public CCodeExpression replacement_expression { get; set; }
public CCodeMacroReplacement (construct string name, construct string replacement) {
public CCodeMacroReplacement (string name, string replacement) {
this.replacement = replacement;
this.name = name;
}
public CCodeMacroReplacement.with_expression (construct string name, construct CCodeExpression replacement_expression) {
public CCodeMacroReplacement.with_expression (string name, CCodeExpression replacement_expression) {
this.name = name;
this.replacement_expression = replacement_expression;
}
public override void write (CCodeWriter writer) {
......
......@@ -34,7 +34,8 @@ public class Vala.CCodeStruct : CCodeNode {
private Gee.List<CCodeDeclaration> declarations = new ArrayList<CCodeDeclaration> ();
public CCodeStruct (construct string name) {
public CCodeStruct (string name) {
this.name = name;
}
/**
......
......@@ -35,7 +35,8 @@ public class Vala.CCodeSwitchStatement : CCodeStatement {
private Gee.List<CCodeCaseStatement> case_statements = new ArrayList<CCodeCaseStatement> ();
private Gee.List<CCodeStatement> default_statements = new ArrayList<CCodeStatement> ();
public CCodeSwitchStatement (construct CCodeExpression expression) {
public CCodeSwitchStatement (CCodeExpression expression) {
this.expression = expression;
}
/**
......
......@@ -43,7 +43,8 @@ public class Gee.ArrayList<G> : Object, Iterable<G>, Collection<G>, List<G> {
// concurrent modification protection
private int _stamp = 0;
public ArrayList (construct EqualFunc equal_func = GLib.direct_equal) {
public ArrayList (EqualFunc equal_func = GLib.direct_equal) {
this.equal_func = equal_func;
}
public Type get_element_type () {
......@@ -165,7 +166,8 @@ public class Gee.ArrayList<G> : Object, Iterable<G>, Collection<G>, List<G> {
// concurrent modification protection
public int _stamp = 0;
public Iterator (construct ArrayList list) {
public Iterator (ArrayList list) {
this.list = list;
}
public bool next () {
......
......@@ -58,7 +58,10 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
private const int MIN_SIZE = 11;
private const int MAX_SIZE = 13845163;
public HashMap (construct HashFunc key_hash_func = GLib.direct_hash, construct EqualFunc key_equal_func = GLib.direct_equal, construct EqualFunc value_equal_func = GLib.direct_equal) {
public HashMap (HashFunc key_hash_func = GLib.direct_hash, EqualFunc key_equal_func = GLib.direct_equal, EqualFunc value_equal_func = GLib.direct_equal) {
this.key_hash_func = key_hash_func;
this.key_equal_func = key_equal_func;
this.value_equal_func = value_equal_func;
}
construct {
......@@ -185,7 +188,8 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
private HashMap<K,V> _map;
public KeySet (construct HashMap map) {
public KeySet (HashMap map) {
this.map = map;
}
public Type get_element_type () {
......@@ -232,7 +236,8 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
// concurrent modification protection
private int _stamp;
public KeyIterator (construct HashMap map) {
public KeyIterator (HashMap map) {
this.map = map;
}
public bool next () {
......@@ -260,7 +265,8 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
private HashMap<K,V> _map;
public ValueCollection (construct HashMap map) {
public ValueCollection (HashMap map) {
this.map = map;
}
public Type get_element_type () {
......@@ -313,7 +319,8 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
// concurrent modification protection
private int _stamp;
public ValueIterator (construct HashMap map) {
public ValueIterator (HashMap map) {
this.map = map;
}
public bool next () {
......
......@@ -53,7 +53,9 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
private const int MIN_SIZE = 11;
private const int MAX_SIZE = 13845163;
public HashSet (construct HashFunc hash_func = GLib.direct_hash, construct EqualFunc equal_func = GLib.direct_equal) {
public HashSet (HashFunc hash_func = GLib.direct_hash, EqualFunc equal_func = GLib.direct_equal) {
this.hash_func = hash_func;
this.equal_func = equal_func;
}
construct {
......@@ -176,7 +178,8 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
// concurrent modification protection
private int _stamp = 0;
public Iterator (construct HashSet set) {
public Iterator (HashSet set) {
this.set = set;
}
public bool next () {
......
......@@ -36,7 +36,8 @@ public class Gee.ReadOnlyCollection<G> : Object, Iterable<G>, Collection<G> {
private Collection<G> _collection;
public ReadOnlyCollection (construct Collection<G> collection = null) {
public ReadOnlyCollection (Collection<G> collection = null) {
this.collection = collection;
}
public Type get_element_type () {
......
......@@ -36,7 +36,8 @@ public class Gee.ReadOnlyList<G> : Object, Iterable<G>, Collection<G>, List<G> {
private List<G> _list;
public ReadOnlyList (construct List<G> list = null) {
public ReadOnlyList (List<G> list = null) {
this.list = list;
}
public Type get_element_type () {
......
......@@ -36,7 +36,8 @@ public class Gee.ReadOnlyMap<K,V> : Object, Map<K,V> {
private Map<K,V> _map;
public ReadOnlyMap (construct Map<K,V> map = null) {
public ReadOnlyMap (Map<K,V> map = null) {
this.map = map;
}
public Set<K> get_keys () {
......
......@@ -36,7 +36,8 @@ public class Gee.ReadOnlySet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
private Set<G> _set;
public ReadOnlySet (construct Set<G> set = null) {
public ReadOnlySet (Set<G> set = null) {
this.set = set;
}
public Type get_element_type () {
......
......@@ -30,7 +30,9 @@ using Gee;
public class Vala.CCodeArrayCreationExpressionBinding : CCodeExpressionBinding {
public ArrayCreationExpression array_creation_expression { get; set; }
public CCodeArrayCreationExpressionBinding (construct CodeGenerator codegen, construct ArrayCreationExpression array_creation_expression) {
public CCodeArrayCreationExpressionBinding (CodeGenerator codegen, ArrayCreationExpression array_creation_expression) {
this.array_creation_expression = array_creation_expression;
this.codegen = codegen;
}
public override void emit () {
......
......@@ -30,7 +30,9 @@ using Gee;
public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
public Assignment assignment { get; set; }
public CCodeAssignmentBinding (construct CodeGenerator codegen, construct Assignment assignment) {
public CCodeAssignmentBinding (CodeGenerator codegen, Assignment assignment) {
this.assignment = assignment;
this.codegen = codegen;
}
private void emit_property_assignment () {
......
......@@ -30,7 +30,9 @@ using Gee;
public class Vala.CCodeElementAccessBinding : CCodeExpressionBinding {
public ElementAccess element_access { get; set; }
public CCodeElementAccessBinding (construct CodeGenerator codegen, construct ElementAccess element_access) {
public CCodeElementAccessBinding (CodeGenerator codegen, ElementAccess element_access) {
this.element_access = element_access;
this.codegen = codegen;
}
public override void emit () {
......
......@@ -33,7 +33,9 @@ public class Vala.CCodeMethodBinding : CCodeBinding {
get { return (method.get_attribute ("NoWrapper") == null); }
}
public CCodeMethodBinding (construct CodeGenerator codegen, construct Method method) {
public CCodeMethodBinding (CodeGenerator codegen, Method method) {
this.method = method;
this.codegen = codegen;
}
public static CCodeMethodBinding get (Method method) {
......
......@@ -27,7 +27,10 @@ using Gee;
* Represents a dynamic bound DBus method.
*/
public class Vala.DBusMethod : Method {
public DBusMethod (construct string name, construct DataType return_type, construct SourceReference source_reference = null) {
public DBusMethod (string name, DataType return_type, SourceReference source_reference = null) {
this.return_type = return_type;
this.source_reference = source_reference;
this.name = name;
}
public override Collection<string> get_cheader_filenames () {
......
......@@ -26,6 +26,9 @@ using GLib;
* Represents a dynamic bound DBus signal.
*/
public class Vala.DBusSignal : Signal {
public DBusSignal (construct string name, construct DataType return_type, construct SourceReference source_reference = null) {
public DBusSignal (string name, DataType return_type, SourceReference source_reference = null) {
this.return_type = return_type;
this.source_reference = source_reference;
this.name = name;
}
}
......@@ -47,7 +47,9 @@ public class Vala.AddressofExpression : Expression {
* @param inner variable whose address is to be computed
* @return newly created address-of expression
*/
public AddressofExpression (construct Expression inner, construct SourceReference source_reference = null) {
public AddressofExpression (Expression inner, SourceReference source_reference = null) {
this.source_reference = source_reference;
this.inner = inner;
}
public override void accept (CodeVisitor visitor) {
......
......@@ -70,7 +70,11 @@ public class Vala.ArrayCreationExpression : Expression {
return new ReadOnlyList<Expression> (sizes);
}
public ArrayCreationExpression (construct DataType element_type, construct int rank, construct InitializerList initializer_list, construct SourceReference source_reference) {
public ArrayCreationExpression (DataType element_type, int rank, InitializerList initializer_list, SourceReference source_reference) {
this.rank = rank;
this.initializer_list = initializer_list;
this.source_reference = source_reference;
this.element_type = element_type;
}
public override void accept_children (CodeVisitor visitor) {
......
......@@ -31,7 +31,8 @@ public class Vala.ArrayLengthField : Field {
*
* @return newly created field
*/
public ArrayLengthField (construct SourceReference source_reference) {
public ArrayLengthField (SourceReference source_reference) {
this.source_reference = source_reference;
name = "length";
}
}
......@@ -31,7 +31,8 @@ public class Vala.ArrayMoveMethod : Method {
*
* @return newly created method
*/
public ArrayMoveMethod (construct SourceReference source_reference) {
public ArrayMoveMethod (SourceReference source_reference) {
this.source_reference = source_reference;
name = "move";
}
}
......@@ -31,7 +31,8 @@ public class Vala.ArrayResizeMethod : Method {
*
* @return newly created method
*/
public ArrayResizeMethod (construct SourceReference source_reference) {
public ArrayResizeMethod (SourceReference source_reference) {
this.source_reference = source_reference;
name = "resize";
}
......
......@@ -67,7 +67,11 @@ public class Vala.Assignment : Expression {
* @param source_reference reference to source code
* @return newly created assignment
*/
public Assignment (construct Expression left, construct Expression right, construct AssignmentOperator operator = AssignmentOperator.SIMPLE, construct SourceReference source_reference = null) {
public Assignment (Expression left, Expression right, AssignmentOperator operator = AssignmentOperator.SIMPLE, SourceReference source_reference = null) {
this.right = right;
this.operator = operator;
this.source_reference = source_reference;
this.left = left;
}
public override void accept (CodeVisitor visitor) {
......
......@@ -44,7 +44,9 @@ public class Vala.Attribute : CodeNode {
* @param source_reference reference to source code
* @return newly created attribute
*/
public Attribute (construct string name, construct SourceReference source_reference) {
public Attribute (string name, SourceReference source_reference) {
this.source_reference = source_reference;
this.name = name;
}
/**
......
......@@ -41,7 +41,8 @@ public class Vala.Block : Symbol, Statement {
*
* @param source reference to source code
*/
public Block (construct SourceReference source_reference = null) {
public Block (SourceReference source_reference = null) {
this.source_reference = source_reference;
}
/**
......
......@@ -66,7 +66,11 @@ public class Vala.CastExpression : Expression {
* @param type target type
* @return newly created cast expression
*/
public CastExpression (construct Expression inner, construct DataType type_reference, construct SourceReference source_reference, construct bool is_silent_cast) {
public CastExpression (Expression inner, DataType type_reference, SourceReference source_reference, bool is_silent_cast) {
this.type_reference = type_reference;
this.source_reference = source_reference;
this.is_silent_cast = is_silent_cast;
this.inner = inner;
}
public override void accept (CodeVisitor visitor) {
......
......@@ -65,7 +65,11 @@ public class Vala.CatchClause : CodeNode {
* @param source_reference reference to source code
* @return newly created catch clause
*/
public CatchClause (construct DataType? type_reference, construct string variable_name, construct Block body, construct SourceReference source_reference = null) {
public CatchClause (DataType? type_reference, string variable_name, Block body, SourceReference source_reference = null) {
this.type_reference = type_reference;
this.variable_name = variable_name;
this.body = body;
this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {
......
......@@ -39,23 +39,32 @@ public class Vala.CFGBuilder : CodeVisitor {
public BasicBlock? last_block { get; set; }
public CatchClause? catch_clause { get; set; }
public JumpTarget.break_target (construct BasicBlock basic_block) {
public JumpTarget.break_target (BasicBlock basic_block) {
this.basic_block = basic_block;
break_target = true;
}
public JumpTarget.continue_target (construct BasicBlock basic_block) {
public JumpTarget.continue_target (BasicBlock basic_block) {
this.basic_block = basic_block;
continue_target = true;
}
public JumpTarget.return_target (construct BasicBlock basic_block) {
public JumpTarget.return_target (BasicBlock basic_block) {
this.basic_block = basic_block;
return_target = true;
}
public JumpTarget.error_target (construct BasicBlock basic_block, construct CatchClause catch_clause, construct Enum? error_domain, construct EnumValue? error_code) {
public JumpTarget.error_target (BasicBlock basic_block, CatchClause catch_clause, Enum? error_domain, EnumValue? error_code) {
this.basic_block = basic_block;
this.catch_clause = catch_clause;
this.error_domain = error_domain;
this.error_code = error_code;
error_target = true;
}
public JumpTarget.finally_clause (construct BasicBlock basic_block, construct BasicBlock last_block) {
public JumpTarget.finally_clause (BasicBlock basic_block, BasicBlock last_block) {
this.basic_block = basic_block;
this.last_block = last_block;
finally_clause = true;
}
}
......
......@@ -111,7 +111,9 @@ public class Vala.Class : Typesymbol {
* @param source reference to source code
* @return newly created class
*/
public Class (construct string name, construct SourceReference source_reference = null) {
public Class (string name, SourceReference source_reference = null) {
this.source_reference = source_reference;
this.name = name;
}
/**
......
......@@ -31,7 +31,8 @@ public class Vala.ClassType : ReferenceType {
*/
public weak Class class_symbol { get; set; }
public ClassType (construct Class class_symbol) {
public ClassType (Class class_symbol) {
this.class_symbol = class_symbol;
data_type = class_symbol;
}
......
......@@ -57,7 +57,11 @@ public class Vala.Constant : Member, Lockable {
* @param source_reference reference to source code
* @return newly created constant
*/
public Constant (construct string name, construct DataType type_reference, construct Expression initializer, construct SourceReference source_reference) {
public Constant (string name, DataType type_reference, Expression initializer, SourceReference source_reference) {
this.type_reference = type_reference;
this.initializer = initializer;
this.source_reference = source_reference;
this.name = name;
}
public override void accept (CodeVisitor visitor) {
......
......@@ -44,7 +44,10 @@ public class Vala.CreationMethod : Method {
* @param source_reference reference to source code
* @return newly created method
*/
public CreationMethod (construct string type_name, construct string name, construct SourceReference source_reference = null) {
public CreationMethod (string type_name, string name, SourceReference source_reference = null) {
this.name = name;
this.source_reference = source_reference;
this.type_name = type_name;
return_type = new VoidType ();
}
......
......@@ -94,7 +94,10 @@ public class Vala.Delegate : Typesymbol {
* @param source reference to source code
* @return newly created delegate
*/
public Delegate (construct string name, construct DataType return_type, construct SourceReference source_reference = null) {
public Delegate (string name, DataType return_type, SourceReference source_reference = null) {
this.return_type = return_type;
this.source_reference = source_reference;
this.name = name;
}
construct {
......
......@@ -29,7 +29,8 @@ using Gee;
public class Vala.DelegateType : DataType {
public Delegate delegate_symbol { get; set; }
public DelegateType (construct Delegate delegate_symbol) {
public DelegateType (Delegate delegate_symbol) {
this.delegate_symbol = delegate_symbol;
}
public override bool is_invokable () {
......
......@@ -47,7 +47,8 @@ public class Vala.Destructor : Symbol {
* @param source_reference reference to source code
* @return newly created destructor
*/
public Destructor (construct SourceReference source_reference = null) {
public Destructor (SourceReference source_reference = null) {
this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {
......
......@@ -63,7 +63,10 @@ public class Vala.DoStatement : CodeNode, Statement {
* @param source reference to source code
* @return newly created do statement
*/
public DoStatement (construct Block body, construct Expression condition, construct SourceReference source_reference = null) {
public DoStatement (Block body, Expression condition, SourceReference source_reference = null) {
this.condition = condition;
this.source_reference = source_reference;
this.body = body;
}
public override void accept (CodeVisitor visitor) {
......
......@@ -47,7 +47,9 @@ public class Vala.ElementAccess : Expression {
return new ReadOnlyList<Expression> (indices);
}
public ElementAccess (construct Expression container, construct SourceReference source_reference) {
public ElementAccess (Expression container, SourceReference source_reference) {
this.source_reference = source_reference;
this.container = container;
}
public override void accept (CodeVisitor visitor) {
......
......@@ -52,7 +52,9 @@ public class Vala.Enum : Typesymbol {
* @param source_reference reference to source code
* @return newly created enum
*/
public Enum (construct string name, construct SourceReference source_reference = null) {
public Enum (string name, SourceReference source_reference = null) {
this.source_reference = source_reference;
this.name = name;
}
/**
......
......@@ -39,7 +39,8 @@ public class Vala.EnumValue : Symbol {
* @param name enum value name
* @return newly created enum value
*/
public EnumValue (construct string name, SourceReference source_reference = null) {
public EnumValue (string name, SourceReference source_reference = null) {
this.name = name;
this.source_reference = source_reference;
}
......@@ -50,7 +51,9 @@ public class Vala.EnumValue : Symbol {
* @param value numerical representation
* @return newly created enum value
*/
public EnumValue.with_value (construct string name, construct Expression value, SourceReference source_reference = null) {
public EnumValue.with_value (string name, Expression value, SourceReference source_reference = null) {
this.name = name;
this.value = value;
this.source_reference = source_reference;
}
......
......@@ -39,7 +39,8 @@ public class Vala.ErrorCode : Symbol {
* @param name enum value name
* @return newly created enum value
*/
public ErrorCode (construct string name) {
public ErrorCode (string name) {
this.name = name;
}
/**
......@@ -49,7 +50,9 @@ public class Vala.ErrorCode : Symbol {
* @param value numerical representation
* @return newly created enum value
*/
public ErrorCode.with_value (construct string name, construct Expression value) {
public ErrorCode.with_value (string name, Expression value) {
this.name = name;
this.value = value;
}
public override void accept (CodeVisitor visitor) {
......
......@@ -41,7 +41,9 @@ public class Vala.ErrorDomain : Typesymbol {
* @param source_reference reference to source code
* @return newly created error domain
*/
public ErrorDomain (construct string name, construct SourceReference source_reference = null) {
public ErrorDomain (string name, SourceReference source_reference = null) {