diff options
Diffstat (limited to 'vala')
90 files changed, 577 insertions, 577 deletions
diff --git a/vala/valaaddressofexpression.vala b/vala/valaaddressofexpression.vala index b5371745d..029325264 100644 --- a/vala/valaaddressofexpression.vala +++ b/vala/valaaddressofexpression.vala @@ -38,7 +38,7 @@ public class Vala.AddressofExpression : Expression { _inner.parent_node = this; } } - + private Expression _inner; /** @@ -51,7 +51,7 @@ public class Vala.AddressofExpression : Expression { this.source_reference = source_reference; this.inner = inner; } - + public override void accept (CodeVisitor visitor) { visitor.visit_addressof_expression (this); diff --git a/vala/valaarraycreationexpression.vala b/vala/valaarraycreationexpression.vala index 3c6fb2a93..2282d6f80 100644 --- a/vala/valaarraycreationexpression.vala +++ b/vala/valaarraycreationexpression.vala @@ -38,17 +38,17 @@ public class Vala.ArrayCreationExpression : Expression { _element_type.parent_node = this; } } - + /** * The rank of the array. */ public int rank { get; set; } - + /** * The size for each dimension ascending from left to right. */ private List<Expression> sizes = new ArrayList<Expression> (); - + /** * The root array initializer list. */ @@ -74,14 +74,14 @@ public class Vala.ArrayCreationExpression : Expression { size.parent_node = this; } } - + /** * Get the sizes for all dimensions ascending from left to right. */ public List<Expression> get_sizes () { return sizes; } - + public ArrayCreationExpression (DataType element_type, int rank, InitializerList? initializer_list, SourceReference source_reference) { this.element_type = element_type; this.rank = rank; diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala index f1ecd7b68..10be086d8 100644 --- a/vala/valaarraytype.vala +++ b/vala/valaarraytype.vala @@ -118,12 +118,12 @@ public class Vala.ArrayType : ReferenceType { resize_method.access = SymbolAccessibility.PUBLIC; resize_method.set_attribute_string ("CCode", "cname", "g_renew"); - + var root_symbol = source_reference.file.context.root; var int_type = new IntegerType ((Struct) root_symbol.scope.lookup ("int")); resize_method.add_parameter (new Parameter ("length", int_type)); - + resize_method.returns_modified_pointer = true; } return resize_method; @@ -185,7 +185,7 @@ public class Vala.ArrayType : ReferenceType { if (element_type.is_weak () && !(parent_node is Constant)) { elem_str = "(unowned %s)".printf (elem_str); } - + if (!fixed_length) { return "%s[%s]%s".printf (elem_str, string.nfill (rank - 1, ','), nullable ? "?" : ""); } else { diff --git a/vala/valaassignment.vala b/vala/valaassignment.vala index 1c62fcdc9..b3e07b466 100644 --- a/vala/valaassignment.vala +++ b/vala/valaassignment.vala @@ -37,12 +37,12 @@ public class Vala.Assignment : Expression { _left.parent_node = this; } } - + /** * Assignment operator. */ public AssignmentOperator operator { get; set; } - + /** * Right hand side of the assignment. */ @@ -53,10 +53,10 @@ public class Vala.Assignment : Expression { _right.parent_node = this; } } - + private Expression _left; private Expression _right; - + /** * Creates a new assignment. * @@ -72,7 +72,7 @@ public class Vala.Assignment : Expression { this.source_reference = source_reference; this.left = left; } - + public override void accept (CodeVisitor visitor) { visitor.visit_assignment (this); @@ -563,7 +563,7 @@ public class Vala.Assignment : Expression { right.get_used_variables (collection); } } - + public enum Vala.AssignmentOperator { NONE, SIMPLE, diff --git a/vala/valaattribute.vala b/vala/valaattribute.vala index ed80d66d7..ba4f8f185 100644 --- a/vala/valaattribute.vala +++ b/vala/valaattribute.vala @@ -66,7 +66,7 @@ public class Vala.Attribute : CodeNode { public void add_argument (string key, string value) { args.set (key, value); } - + /** * Returns whether this attribute has the specified named argument. * @@ -76,7 +76,7 @@ public class Vala.Attribute : CodeNode { public bool has_argument (string name) { return args.contains (name); } - + /** * Returns the string value of the specified named argument. * @@ -95,7 +95,7 @@ public class Vala.Attribute : CodeNode { /* unescape string */ return noquotes.compress (); } - + /** * Returns the integer value of the specified named argument. * diff --git a/vala/valabaseaccess.vala b/vala/valabaseaccess.vala index 805854068..7631f9e79 100644 --- a/vala/valabaseaccess.vala +++ b/vala/valabaseaccess.vala @@ -34,7 +34,7 @@ public class Vala.BaseAccess : Expression { public BaseAccess (SourceReference? source = null) { source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_base_access (this); diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala index ecfdda5e3..6fac539fd 100644 --- a/vala/valabinaryexpression.vala +++ b/vala/valabinaryexpression.vala @@ -31,7 +31,7 @@ public class Vala.BinaryExpression : Expression { * The binary operator. */ public BinaryOperator operator { get; set; } - + /** * The left operand. */ @@ -44,7 +44,7 @@ public class Vala.BinaryExpression : Expression { _left.parent_node = this; } } - + /** * The right operand. */ @@ -57,12 +57,12 @@ public class Vala.BinaryExpression : Expression { _right.parent_node = this; } } - + public bool is_chained { get; private set; } private Expression _left; private Expression _right; - + /** * Creates a new binary expression. * @@ -96,7 +96,7 @@ public class Vala.BinaryExpression : Expression { public override void accept_children (CodeVisitor visitor) { left.accept (visitor); - right.accept (visitor); + right.accept (visitor); } public override void replace_expression (Expression old_node, Expression new_node) { @@ -247,7 +247,7 @@ public class Vala.BinaryExpression : Expression { } else if (right.value_type != null) { local_type = right.value_type.copy (); } - + var local = new LocalVariable (local_type, get_temp_name (), left, source_reference); var decl = new DeclarationStatement (local, source_reference); @@ -539,9 +539,9 @@ public class Vala.BinaryExpression : Expression { parent_node.replace_expression (this, contains_call); return contains_call.check (context); } - + value_type = context.analyzer.bool_type; - + } else { assert_not_reached (); } diff --git a/vala/valablock.vala b/vala/valablock.vala index 4064b6e90..372e70955 100644 --- a/vala/valablock.vala +++ b/vala/valablock.vala @@ -37,7 +37,7 @@ public class Vala.Block : Symbol, Statement { private List<Statement> statement_list = new ArrayList<Statement> (); private List<LocalVariable> local_variables = new ArrayList<LocalVariable> (); private List<Constant> local_constants = new ArrayList<Constant> (); - + /** * Creates a new block. * @@ -46,7 +46,7 @@ public class Vala.Block : Symbol, Statement { public Block (SourceReference? source_reference) { base (null, source_reference); } - + /** * Append a statement to this block. * @@ -81,7 +81,7 @@ public class Vala.Block : Symbol, Statement { } return list; } - + /** * Add a local variable to this block. * diff --git a/vala/valabooleanliteral.vala b/vala/valabooleanliteral.vala index 1a1aee86e..37ec154a7 100644 --- a/vala/valabooleanliteral.vala +++ b/vala/valabooleanliteral.vala @@ -42,7 +42,7 @@ public class Vala.BooleanLiteral : Literal { value = b; source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_boolean_literal (this); diff --git a/vala/valabreakstatement.vala b/vala/valabreakstatement.vala index 3f69c851f..e8f2dd8bf 100644 --- a/vala/valabreakstatement.vala +++ b/vala/valabreakstatement.vala @@ -35,7 +35,7 @@ public class Vala.BreakStatement : CodeNode, Statement { public BreakStatement (SourceReference? source) { source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_break_statement (this); } diff --git a/vala/valacastexpression.vala b/vala/valacastexpression.vala index ecf093dc5..8d35e1e86 100644 --- a/vala/valacastexpression.vala +++ b/vala/valacastexpression.vala @@ -37,7 +37,7 @@ public class Vala.CastExpression : Expression { _inner.parent_node = this; } } - + /** * The target type. */ diff --git a/vala/valacatchclause.vala b/vala/valacatchclause.vala index 84e4ba340..93996a910 100644 --- a/vala/valacatchclause.vala +++ b/vala/valacatchclause.vala @@ -37,12 +37,12 @@ public class Vala.CatchClause : CodeNode { } } } - + /** * Specifies the error variable name. */ public string? variable_name { get; set; } - + /** * Specifies the error handler body. */ @@ -53,7 +53,7 @@ public class Vala.CatchClause : CodeNode { _body.parent_node = this; } } - + /** * Specifies the declarator for the generated error variable. */ diff --git a/vala/valacharacterliteral.vala b/vala/valacharacterliteral.vala index cecddbac4..24b1faeea 100644 --- a/vala/valacharacterliteral.vala +++ b/vala/valacharacterliteral.vala @@ -37,13 +37,13 @@ public class Vala.CharacterLiteral : Literal { } set { _value = value; - + if (!value.validate ()) { error = true; } } } - + private string _value; /** @@ -64,7 +64,7 @@ public class Vala.CharacterLiteral : Literal { visitor.visit_expression (this); } - + /** * Returns the unicode character value this character literal * represents. diff --git a/vala/valaclass.vala b/vala/valaclass.vala index f61bb350e..b0de0f536 100644 --- a/vala/valaclass.vala +++ b/vala/valaclass.vala @@ -30,7 +30,7 @@ public class Vala.Class : ObjectTypeSymbol { * Specifies the base class. */ public Class base_class { get; set; } - + /** * Specifies whether this class is abstract. Abstract classes may not be * instantiated. @@ -89,7 +89,7 @@ public class Vala.Class : ObjectTypeSymbol { * Specifies whether this class has private fields. */ public bool has_private_fields { get; set; } - + /** * Specifies whether this class has class fields. */ @@ -104,7 +104,7 @@ public class Vala.Class : ObjectTypeSymbol { * Specifies the default construction method. */ public CreationMethod default_construction_method { get; set; } - + /** * Specifies the instance constructor. */ @@ -141,7 +141,7 @@ public class Vala.Class : ObjectTypeSymbol { * Specifies the class destructor. */ public Destructor? static_destructor { get; set; } - + /** * Specifies the class destructor. */ @@ -204,7 +204,7 @@ public class Vala.Class : ObjectTypeSymbol { has_class_private_fields = true; } } - + /** * Adds the specified method as a member to this class. * @@ -263,7 +263,7 @@ public class Vala.Class : ObjectTypeSymbol { add_field (prop.field); } } - + public override void add_constructor (Constructor c) { if (c.binding == MemberBinding.INSTANCE) { if (constructor != null) { @@ -323,23 +323,23 @@ public class Vala.Class : ObjectTypeSymbol { foreach (Field f in get_fields ()) { f.accept (visitor); } - + foreach (Constant c in get_constants ()) { c.accept (visitor); } - + foreach (Method m in get_methods ()) { m.accept (visitor); } - + foreach (Property prop in get_properties ()) { prop.accept (visitor); } - + foreach (Signal sig in get_signals ()) { sig.accept (visitor); } - + if (constructor != null) { constructor.accept (visitor); } @@ -363,11 +363,11 @@ public class Vala.Class : ObjectTypeSymbol { if (class_destructor != null) { class_destructor.accept (visitor); } - + foreach (Class cl in get_classes ()) { cl.accept (visitor); } - + foreach (Struct st in get_structs ()) { st.accept (visitor); } @@ -398,7 +398,7 @@ public class Vala.Class : ObjectTypeSymbol { return true; } } - + return false; } @@ -509,15 +509,15 @@ public class Vala.Class : ObjectTypeSymbol { foreach (Field f in get_fields ()) { f.check (context); } - + foreach (Constant c in get_constants ()) { c.check (context); } - + foreach (Method m in get_methods ()) { m.check (context); } - + foreach (Property prop in get_properties ()) { if (prop.get_attribute ("NoAccessorMethod") != null && !is_subtype_of (context.analyzer.object_type)) { error = true; @@ -526,11 +526,11 @@ public class Vala.Class : ObjectTypeSymbol { } prop.check (context); } - + foreach (Signal sig in get_signals ()) { sig.check (context); } - + if (constructor != null) { constructor.check (context); } @@ -550,15 +550,15 @@ public class Vala.Class : ObjectTypeSymbol { if (static_destructor != null) { static_destructor.check (context); } - + if (class_destructor != null) { class_destructor.check (context); } - + foreach (Class cl in get_classes ()) { cl.check (context); } - + foreach (Struct st in get_structs ()) { st.check (context); } diff --git a/vala/valaclasstype.vala b/vala/valaclasstype.vala index a0430a12c..20841cf13 100644 --- a/vala/valaclasstype.vala +++ b/vala/valaclasstype.vala @@ -42,11 +42,11 @@ public class Vala.ClassType : ReferenceType { result.nullable = nullable; result.is_dynamic = is_dynamic; result.floating_reference = floating_reference; - + foreach (DataType arg in get_type_arguments ()) { result.add_type_argument (arg.copy ()); } - + return result; } } diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala index d3955df70..17b35c9fd 100644 --- a/vala/valacodecontext.vala +++ b/vala/valacodecontext.vala @@ -189,7 +189,7 @@ public class Vala.CodeContext { public bool vapi_comments { get; set; } /** - * Returns true if the target version of glib is greater than or + * Returns true if the target version of glib is greater than or * equal to the specified version. */ public bool require_glib_version (int major, int minor) { @@ -300,7 +300,7 @@ public class Vala.CodeContext { public List<string> get_c_source_files () { return c_source_files; } - + /** * Adds the specified file to the list of source files. * diff --git a/vala/valacodenode.vala b/vala/valacodenode.vala index 5413ed434..70bc77f0a 100644 --- a/vala/valacodenode.vala +++ b/vala/valacodenode.vala @@ -61,7 +61,7 @@ public abstract class Vala.CodeNode { /** * Specifies that this node or a child node may throw an exception. */ - public bool tree_can_fail { + public bool tree_can_fail { get { return _error_types != null && _error_types.size > 0; } } @@ -75,7 +75,7 @@ public abstract class Vala.CodeNode { /** * Specifies the exceptions that can be thrown by this node or a child node */ - public List<DataType> get_error_types () { + public List<DataType> get_error_types () { if (_error_types != null) { return _error_types; } @@ -87,7 +87,7 @@ public abstract class Vala.CodeNode { /** * Adds an error type to the exceptions that can be thrown by this node - * or a child node + * or a child node */ public void add_error_type (DataType error_type) { if (_error_types == null) { @@ -99,7 +99,7 @@ public abstract class Vala.CodeNode { /** * Adds a collection of error types to the exceptions that can be thrown by this node - * or a child node + * or a child node */ public void add_error_types (List<DataType> error_types) { foreach (DataType error_type in error_types) { diff --git a/vala/valacodevisitor.vala b/vala/valacodevisitor.vala index c9b158694..d961f85e9 100644 --- a/vala/valacodevisitor.vala +++ b/vala/valacodevisitor.vala @@ -516,7 +516,7 @@ public abstract class Vala.CodeVisitor { */ public virtual void visit_method_call (MethodCall expr) { } - + /** * Visit operation called for element access expressions. * diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala index 2fed2d8f5..b442bb239 100644 --- a/vala/valacodewriter.vala +++ b/vala/valacodewriter.vala @@ -31,9 +31,9 @@ public class Vala.CodeWriter : CodeVisitor { static GLib.Regex fix_indent_regex; private CodeContext context; - + FileStream stream; - + int indent; /* at begin of line */ bool bol = true; @@ -240,7 +240,7 @@ public class Vala.CodeWriter : CodeVisitor { } write_attributes (cl); - + write_indent (); write_accessibility (cl); if (cl.is_abstract) { @@ -254,7 +254,7 @@ public class Vala.CodeWriter : CodeVisitor { var base_types = cl.get_base_types (); if (base_types.size > 0) { write_string (" : "); - + bool first = true; foreach (DataType base_type in base_types) { if (!first) { @@ -392,7 +392,7 @@ public class Vala.CodeWriter : CodeVisitor { var prerequisites = iface.get_prerequisites (); if (prerequisites.size > 0) { write_string (" : "); - + bool first = true; foreach (DataType prerequisite in prerequisites) { if (!first) { @@ -565,7 +565,7 @@ public class Vala.CodeWriter : CodeVisitor { write_string ("const "); write_type (c.type_reference); - + write_string (" "); write_identifier (c.name); write_type_suffix (c.type_reference); @@ -606,14 +606,14 @@ public class Vala.CodeWriter : CodeVisitor { } write_type (f.variable_type); - + write_string (" "); write_identifier (f.name); write_type_suffix (f.variable_type); write_string (";"); write_newline (); } - + private void write_error_domains (List<DataType> error_domains) { if (error_domains.size > 0) { write_string (" throws "); @@ -639,12 +639,12 @@ public class Vala.CodeWriter : CodeVisitor { if (i > 1) { write_string (", "); } - + if (param.ellipsis) { write_string ("..."); continue; } - + write_attributes (param); if (param.params_array) { @@ -671,7 +671,7 @@ public class Vala.CodeWriter : CodeVisitor { write_string (" "); write_identifier (param.name); write_type_suffix (param.variable_type); - + if (param.initializer != null) { write_string (" = "); param.initializer.accept (this); @@ -702,16 +702,16 @@ public class Vala.CodeWriter : CodeVisitor { write_accessibility (cb); write_string ("delegate "); - + write_return_type (cb.return_type); - + write_string (" "); write_identifier (cb.name); write_type_parameters (cb.get_type_parameters ()); write_string (" "); - + write_params (cb.get_parameters ()); write_error_domains (cb.get_error_types ()); @@ -756,7 +756,7 @@ public class Vala.CodeWriter : CodeVisitor { write_indent (); write_accessibility (m); - + if (m is CreationMethod) { if (m.coroutine) { write_string ("async "); @@ -789,7 +789,7 @@ public class Vala.CodeWriter : CodeVisitor { if (m.coroutine) { write_string ("async "); } - + write_return_type (m.return_type); write_string (" "); @@ -799,7 +799,7 @@ public class Vala.CodeWriter : CodeVisitor { write_string (" "); } - + write_params (m.get_parameters ()); write_error_domains (m.get_error_types ()); @@ -879,13 +879,13 @@ public class Vala.CodeWriter : CodeVisitor { if (!check_accessibility (sig)) { return; } - + if (context.vapi_comments && sig.comment != null) { write_comment (sig.comment); } write_attributes (sig); - + write_indent (); write_accessibility (sig); @@ -894,14 +894,14 @@ public class Vala.CodeWriter : CodeVisitor { } write_string ("signal "); - + write_return_type (sig.return_type); - + write_string (" "); write_identifier (sig.name); - + write_string (" "); - + write_params (sig.get_parameters ()); write_string (";"); @@ -1235,7 +1235,7 @@ public class Vala.CodeWriter : CodeVisitor { write_string (")"); } - + public override void visit_element_access (ElementAccess expr) { expr.container.accept (this); write_string ("["); @@ -1530,13 +1530,13 @@ public class Vala.CodeWriter : CodeVisitor { write_string (fixed_content); write_string ("*/"); } - + private void write_identifier (string s) { char* id = (char*)s; int id_length = (int)s.length; if (Vala.Scanner.get_identifier_or_keyword (id, id_length) != Vala.TokenType.IDENTIFIER || s.get_char ().isdigit ()) { - stream.putc ('@'); + stream.putc ('@'); } write_string (s); } @@ -1566,12 +1566,12 @@ public class Vala.CodeWriter : CodeVisitor { stream.puts (s); bol = false; } - + private void write_newline () { stream.putc ('\n'); bol = true; } - + void write_code_block (Block? block) { if (block == null || type != CodeWriterType.DUMP) { write_string (";"); @@ -1591,7 +1591,7 @@ public class Vala.CodeWriter : CodeVisitor { write_newline (); indent++; } - + private void write_end_block () { indent--; write_indent (); diff --git a/vala/valaconditionalexpression.vala b/vala/valaconditionalexpression.vala index 74cba969b..d139caeb4 100644 --- a/vala/valaconditionalexpression.vala +++ b/vala/valaconditionalexpression.vala @@ -83,7 +83,7 @@ public class Vala.ConditionalExpression : Expression { false_expression = false_expr; source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_conditional_expression (this); diff --git a/vala/valaconstant.vala b/vala/valaconstant.vala index 230c63d5e..e50951b45 100644 --- a/vala/valaconstant.vala +++ b/vala/valaconstant.vala @@ -88,7 +88,7 @@ public class Vala.Constant : Symbol, Lockable { public bool get_lock_used () { return lock_used; } - + public void set_lock_used (bool used) { lock_used = used; } diff --git a/vala/valacontinuestatement.vala b/vala/valacontinuestatement.vala index 1de109dbf..dc9c93950 100644 --- a/vala/valacontinuestatement.vala +++ b/vala/valacontinuestatement.vala @@ -35,7 +35,7 @@ public class Vala.ContinueStatement : CodeNode, Statement { public ContinueStatement (SourceReference source) { source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_continue_statement (this); } diff --git a/vala/valadatatype.vala b/vala/valadatatype.vala index 67f4185e8..1bbbc82b6 100644 --- a/vala/valadatatype.vala +++ b/vala/valadatatype.vala @@ -43,7 +43,7 @@ public abstract class Vala.DataType : CodeNode { * The referred data type. */ public weak TypeSymbol data_type { get; set; } - + /** * Specifies that the expression transfers a floating reference. */ @@ -69,7 +69,7 @@ public abstract class Vala.DataType : CodeNode { type_argument_list.add (arg); arg.parent_node = this; } - + /** * Returns a copy of the list of generic type arguments. * @@ -166,7 +166,7 @@ public abstract class Vala.DataType : CodeNode { return s; } - + /** * Creates a shallow copy of this type reference. * @@ -214,10 +214,10 @@ public abstract class Vala.DataType : CodeNode { if (!type2_args[i].equals (type_args[i])) return false; } - + return true; } - + /** * Checks whether this type reference is at least as strict as the * specified type reference type2. @@ -229,7 +229,7 @@ public abstract class Vala.DataType : CodeNode { if (type2.is_disposable () != is_disposable ()) { return false; } - + if (!type2.nullable && nullable) { return false; } @@ -248,7 +248,7 @@ public abstract class Vala.DataType : CodeNode { if (type2.floating_reference != floating_reference) { return false; } - + return true; } diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala index 3e79527a8..258fe4d4e 100644 --- a/vala/valadelegate.vala +++ b/vala/valadelegate.vala @@ -124,7 +124,7 @@ public class Vala.Delegate : TypeSymbol, Callable { public List<Parameter> get_parameters () { return parameters; } - + /** * Checks whether the arguments and return type of the specified method * matches this callback. @@ -142,7 +142,7 @@ public class Vala.Delegate : TypeSymbol, Callable { if (!m.return_type.stricter (return_type.get_actual_type (dt, null, this))) { return false; } - + var method_params = m.get_parameters (); Iterator<Parameter> method_params_it = method_params.iterator (); @@ -179,7 +179,7 @@ public class Vala.Delegate : TypeSymbol, Callable { return false; } } - + /* method may not expect more arguments */ if (method_params_it.next ()) { return false; @@ -219,9 +219,9 @@ public class Vala.Delegate : TypeSymbol, Callable { foreach (TypeParameter p in type_parameters) { p.accept (visitor); } - + return_type.accept (visitor); - + foreach (Parameter param in parameters) { param.accept (visitor); } @@ -265,9 +265,9 @@ public class Vala.Delegate : TypeSymbol, Callable { foreach (TypeParameter p in type_parameters) { p.check (context); } - + return_type.check (context); - + foreach (Parameter param in parameters) { param.check (context); } diff --git a/vala/valadostatement.vala b/vala/valadostatement.vala index c368b5b28..b7fa03660 100644 --- a/vala/valadostatement.vala +++ b/vala/valadostatement.vala @@ -77,7 +77,7 @@ public class Vala.DoStatement : CodeNode, Statement { body.accept (visitor); condition.accept (visitor); - + visitor.visit_end_full_expression (condition); } diff --git a/vala/valaelementaccess.vala b/vala/valaelementaccess.vala index 4fb44b8c4..993f9c1f5 100644 --- a/vala/valaelementaccess.vala +++ b/vala/valaelementaccess.vala @@ -56,12 +56,12 @@ public class Vala.ElementAccess : Expression { public List<Expression> get_indices () { return indices; } - + public ElementAccess (Expression container, SourceReference source_reference) { this.source_reference = source_reference; this.container = container; } - + public override void accept (CodeVisitor visitor) { visitor.visit_element_access (this); @@ -79,7 +79,7 @@ public class Vala.ElementAccess : Expression { if (container == old_node) { container = new_node; } - + int index = indices.index_of (old_node); if (index >= 0 && new_node.parent_node == null) { indices[index] = new_node; diff --git a/vala/valaemptystatement.vala b/vala/valaemptystatement.vala index 1cc6ae0aa..259574ac4 100644 --- a/vala/valaemptystatement.vala +++ b/vala/valaemptystatement.vala @@ -35,7 +35,7 @@ public class Vala.EmptyStatement : CodeNode, Statement { public EmptyStatement (SourceReference source) { source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_empty_statement (this); } diff --git a/vala/valaenum.vala b/vala/valaenum.vala index add510783..ad0a6b6d8 100644 --- a/vala/valaenum.vala +++ b/vala/valaenum.vala @@ -54,7 +54,7 @@ public class Vala.Enum : TypeSymbol { public Enum (string name, SourceReference? source_reference = null, Comment? comment = null) { base (name, source_reference, comment); } - + /** * Appends the specified enum value to the list of values. * @@ -75,7 +75,7 @@ public class Vala.Enum : TypeSymbol { public override void add_method (Method m) { if (m is CreationMethod) { Report.error (m.source_reference, "construction methods may only be declared within classes and structs"); - + m.error = true; return; } diff --git a/vala/valaenumvalue.vala b/vala/valaenumvalue.vala index b4d27bf06..6d2f35bb1 100644 --- a/vala/valaenumvalue.vala +++ b/vala/valaenumvalue.vala @@ -36,7 +36,7 @@ public class Vala.EnumValue : Constant { public EnumValue (string name, Expression? value, SourceReference? source_reference = null, Comment? comment = null) { base (name, null, value, source_reference, comment); } - + public override void accept (CodeVisitor visitor) { visitor.visit_enum_value (this); } diff --git a/vala/valaerrorcode.vala b/vala/valaerrorcode.vala index aa97641c5..93308aec2 100644 --- a/vala/valaerrorcode.vala +++ b/vala/valaerrorcode.vala @@ -52,7 +52,7 @@ public class Vala.ErrorCode : TypeSymbol { this (name, source_reference); this.value = value; } - + public override void accept (CodeVisitor visitor) { visitor.visit_error_code (this); } diff --git a/vala/valaerrordomain.vala b/vala/valaerrordomain.vala index a73dcf84d..1c63e51f3 100644 --- a/vala/valaerrordomain.vala +++ b/vala/valaerrordomain.vala @@ -39,7 +39,7 @@ public class Vala.ErrorDomain : TypeSymbol { public ErrorDomain (string name, SourceReference? source_reference = null, Comment? comment = null) { base (name, source_reference, comment); } - + /** * Appends the specified code to the list of error codes. * @@ -58,7 +58,7 @@ public class Vala.ErrorDomain : TypeSymbol { public override void add_method (Method m) { if (m is CreationMethod) { Report.error (m.source_reference, "construction methods may only be declared within classes and structs"); - + m.error = true; return; } @@ -106,7 +106,7 @@ public class Vala.ErrorDomain : TypeSymbol { public override bool is_reference_type () { return false; } - + public override bool check (CodeContext context) { if (checked) { return !error; diff --git a/vala/valaexpression.vala b/vala/valaexpression.vala index 5f7a02333..885d82b9d 100644 --- a/vala/valaexpression.vala +++ b/vala/valaexpression.vala @@ -28,7 +28,7 @@ using GLib; public abstract class Vala.Expression : CodeNode { /** * The static type of the value of this expression. - * + * * The semantic analyzer computes this value. */ public DataType value_type { get; set; } diff --git a/vala/valafield.vala b/vala/valafield.vala index 88f80905d..f0605543c 100644 --- a/vala/valafield.vala +++ b/vala/valafield.vala @@ -59,7 +59,7 @@ public class Vala.Field : Variable, Lockable { public override void accept_children (CodeVisitor visitor) { variable_type.accept (visitor); - + if (initializer != null) { initializer.accept (visitor); } @@ -68,7 +68,7 @@ public class Vala.Field : Variable, Lockable { public bool get_lock_used () { return lock_used; } - + public void set_lock_used (bool used) { lock_used = used; } diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala index 853eae73d..1fd580a46 100644 --- a/vala/valaflowanalyzer.vala +++ b/vala/valaflowanalyzer.vala @@ -443,7 +443,7 @@ public class Vala.FlowAnalyzer : CodeVisitor { foreach (CodeNode node in block.get_nodes ()) { var used_variables = new ArrayList<Variable> (); node.get_used_variables (used_variables); - + foreach (Variable var_symbol in used_variables) { var variable_stack = var_map.get (var_symbol); if (variable_stack == null || variable_stack.size == 0) { diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala index 4de3f52bd..4d928429f 100644 --- a/vala/valaforeachstatement.vala +++ b/vala/valaforeachstatement.vala @@ -38,12 +38,12 @@ public class Vala.ForeachStatement : Block { } } } - + /** * Specifies the element variable name. */ public string variable_name { get; set; } - + /** * Specifies the container. */ @@ -56,7 +56,7 @@ public class Vala.ForeachStatement : Block { _collection.parent_node = this; } } - + /** * Specifies the loop body. */ @@ -109,7 +109,7 @@ public class Vala.ForeachStatement : Block { this.body = body; this.type_reference = type_reference; } - + public override void accept (CodeVisitor visitor) { if (use_iterator) { base.accept (visitor); @@ -167,7 +167,7 @@ public class Vala.ForeachStatement : Block { var collection_type = collection.value_type.copy (); collection.target_type = collection_type.copy (); - + if (collection_type.is_array ()) { var array_type = (ArrayType) collection_type; diff --git a/vala/valaforstatement.vala b/vala/valaforstatement.vala index ab80af520..80ff8dbeb 100644 --- a/vala/valaforstatement.vala +++ b/vala/valaforstatement.vala @@ -40,7 +40,7 @@ public class Vala.ForStatement : CodeNode, Statement { } } } - + /** * Specifies the loop body. */ @@ -73,7 +73,7 @@ public class Vala.ForStatement : CodeNode, Statement { this.body = body; this.source_reference = source_reference; } - + /** * Appends the specified expression to the list of initializers. * @@ -83,7 +83,7 @@ public class Vala.ForStatement : CodeNode, Statement { init.parent_node = this; initializer.add (init); } - + /** * Returns a copy of the list of initializers. * @@ -92,7 +92,7 @@ public class Vala.ForStatement : CodeNode, Statement { public List<Expression> get_initializer () { return initializer; } - + /** * Appends the specified expression to the iterator. * @@ -102,7 +102,7 @@ public class Vala.ForStatement : CodeNode, Statement { iter.parent_node = this; iterator.add (iter); } - + /** * Returns a copy of the iterator. * @@ -111,11 +111,11 @@ public class Vala.ForStatement : CodeNode, Statement { public List<Expression> get_iterator () { return iterator; } - + public override void accept (CodeVisitor visitor) { visitor.visit_for_statement (this); } - + public override void accept_children (CodeVisitor visitor) { foreach (Expression init_expr in initializer) { init_expr.accept (visitor); @@ -132,7 +132,7 @@ public class Vala.ForStatement : CodeNode, Statement { it_expr.accept (visitor); visitor.visit_end_full_expression (it_expr); } - + body.accept (visitor); } diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala index dfffa23a7..e563580aa 100644 --- a/vala/valagenieparser.vala +++ b/vala/valagenieparser.vala @@ -40,9 +40,9 @@ public class Vala.Genie.Parser : CodeVisitor { int size; Comment comment; - + string class_name; - + /* hack needed to know if any part of an expression is a lambda one */ bool current_expr_is_lambda; @@ -140,9 +140,9 @@ public class Vala.Genie.Parser : CodeVisitor { } return false; } - + inline bool accept_block () { - + bool has_term = accept_terminator (); if (accept (TokenType.INDENT)) { @@ -197,7 +197,7 @@ public class Vala.Genie.Parser : CodeVisitor { inline SourceLocation get_location () { return tokens[index].begin; } - + string get_current_string () { var token = tokens[index]; return ((string) token.begin.pos).substring (0, (int) (token.end.pos - token.begin.pos)); @@ -378,7 +378,7 @@ public class Vala.Genie.Parser : CodeVisitor { SourceReference src_begin = get_src (begin); expect (TokenType.CLOSE_REGEX_LITERAL); string close_token = get_last_string (); - return new RegexLiteral ("%s/%s".printf (close_token, match_part), src_begin); + return new RegexLiteral ("%s/%s".printf (close_token, match_part), src_begin); case TokenType.STRING_LITERAL: next (); return new StringLiteral (get_last_string (), get_src (begin)); @@ -389,7 +389,7 @@ public class Vala.Genie.Parser : CodeVisitor { next (); string raw_string = get_last_string (); string escaped_string = raw_string.substring (3, raw_string.length - 6).escape (""); - return new StringLiteral ("\"%s\"".printf (escaped_string), get_src (begin)); + return new StringLiteral ("\"%s\"".printf (escaped_string), get_src (begin)); case TokenType.NULL: next (); return new NullLiteral (get_src (begin)); @@ -409,7 +409,7 @@ public class Vala.Genie.Parser : CodeVisitor { scanner.indent_spaces = 0; index = -1; size = 0; - + next (); try { @@ -427,13 +427,13 @@ public class Vala.Genie.Parser : CodeVisitor { rollback (begin); } } - + parse_using_directives (context.root); parse_declarations (context.root, true); } catch (ParseError e) { report_parse_error (e); } - + scanner = null; if (!has_global_context) { context = null; @@ -457,24 +457,24 @@ public class Vala.Genie.Parser : CodeVisitor { } void skip_type () throws ParseError { - + accept (TokenType.DYNAMIC); accept (TokenType.OWNED); accept (TokenType.UNOWNED); accept (TokenType.WEAK); - + if (accept (TokenType.ARRAY) || accept (TokenType.LIST) || accept (TokenType.DICT)) { accept (TokenType.OF); } - + if (accept (TokenType.VOID)) { } else { skip_symbol_name (); skip_type_argument_list (); } - - while (accept (TokenType.OPEN_BRACKET)) { + + while (accept (TokenType.OPEN_BRACKET)) { do { if (current () != TokenType.COMMA && current () != TokenType.CLOSE_BRACKET) { parse_expression (); @@ -486,8 +486,8 @@ public class Vala.Genie.Parser : CodeVisitor { accept (TokenType.INTERR); accept (TokenType.HASH); } - - + + Expression parse_regex_literal () throws ParseError { expect (TokenType.OPEN_REGEX_LITERAL); @@ -501,10 +501,10 @@ public class Vala.Genie.Parser : CodeVisitor { List<DataType> type_arg_list = null; UnresolvedSymbol sym = null; - + bool is_dynamic = accept (TokenType.DYNAMIC); bool value_owned = owned_by_default; - + if (owned_by_default) { if (accept (TokenType.UNOWNED)) { value_owned = false; @@ -520,36 +520,36 @@ public class Vala.Genie.Parser : CodeVisitor { /* handle arrays */ bool is_array = false; - + if (accept (TokenType.ARRAY)) { expect (TokenType.OF); is_array = true; } - + /* handle lists */ bool is_list = false; - + if (accept (TokenType.LIST)) { expect (TokenType.OF); prev (); is_list = true; } - + /* handle dicts */ bool is_dict = false; - + if (accept (TokenType.DICT)) { expect (TokenType.OF); prev (); is_dict = true; } - + DataType type; - + if (!is_dynamic && value_owned == owned_by_default && accept (TokenType.VOID)) { type = new VoidType (get_src (begin)); } else { - + if (is_list) { var sym_parent = new UnresolvedSymbol (null, "Gee", get_src (begin)); sym = new UnresolvedSymbol (sym_parent, "ArrayList", get_src (begin)); @@ -559,7 +559,7 @@ public class Vala.Genie.Parser : CodeVisitor { } else { sym = parse_symbol_name (); } - + type_arg_list = parse_type_argument_list (false); type = new UnresolvedType.from_symbol (sym, get_src (begin)); @@ -569,7 +569,7 @@ public class Vala.Genie.Parser : CodeVisitor { } } } - + while (accept (TokenType.STAR)) { type = new PointerType (type, get_src (begin)); } @@ -579,16 +579,16 @@ public class Vala.Genie.Parser : CodeVisitor { } if (is_array) { - + if (!accept (TokenType.OPEN_BRACKET)) { type.value_owned = true; type = new ArrayType (type, 1, get_src (begin)); type.nullable = accept (TokenType.INTERR); - + } else { prev (); - - while (accept (TokenType.OPEN_BRACKET)) { + + while (accept (TokenType.OPEN_BRACKET)) { bool invalid_array = false; int array_rank = 0; do { @@ -605,14 +605,14 @@ public class Vala.Genie.Parser : CodeVisitor { type.value_owned = true; var array_type = new ArrayType (type, array_rank, get_src (begin)); array_type.nullable = accept (TokenType.INTERR); - + array_type.invalid_syntax = invalid_array; - + type = array_type; } } } - + if (!owned_by_default) { value_owned = accept (TokenType.HASH); } @@ -620,7 +620,7 @@ public class Vala.Genie.Parser : CodeVisitor { if (type is PointerType) { value_owned = false; } - + type.is_dynamic = is_dynamic; type.value_owned = value_owned; return type; @@ -660,7 +660,7 @@ public class Vala.Genie.Parser : CodeVisitor { } return list; } - + Expression parse_argument () throws ParseError { var begin = get_location (); @@ -703,7 +703,7 @@ public class Vala.Genie.Parser : CodeVisitor { expr = parse_literal (); break; case TokenType.ASSERT: - return parse_assert_expression (); + return parse_assert_expression (); case TokenType.OPEN_BRACE: expr = parse_initializer (); break; @@ -735,7 +735,7 @@ public class Vala.Genie.Parser : CodeVisitor { break; case TokenType.YIELD: expr = parse_yield_expression (); - break; + break; default: expr = parse_simple_name (); break; @@ -763,7 +763,7 @@ public class Vala.Genie.Parser : CodeVisitor { case TokenType.OP_DEC: expr = parse_post_decrement_expression (begin, expr); break; - + default: found = false; break; @@ -857,12 +857,12 @@ public class Vala.Genie.Parser : CodeVisitor { var p_expr = parse_expression (); if (i == 0) { i++; - - if (p_expr != null) { + + if (p_expr != null) { if (p_expr is StringLiteral) { var s_exp = (StringLiteral) p_expr; var len = s_exp.value.length; - + if (len > 2) { string s = "\\n\""; var st = s_exp.value.substring (0, len-1); @@ -878,7 +878,7 @@ public class Vala.Genie.Parser : CodeVisitor { list.add (s_exp); } } - } + } list.add (p_expr); } while (accept (TokenType.COMMA)); @@ -888,12 +888,12 @@ public class Vala.Genie.Parser : CodeVisitor { Expression parse_print_expression () throws ParseError { var begin = get_location (); - + expect (TokenType.PRINT); bool parens = accept (TokenType.OPEN_PARENS); var expr = new MemberAccess (null, "print", get_src (begin)); - + var arg_list = parse_print_argument_list (); if (parens) { @@ -901,23 +901,23 @@ public class Vala.Genie.Parser : CodeVisitor { } var print_expr = new MethodCall (expr, get_src (begin)); - + foreach (Expression arg in arg_list) { print_expr.add_argument (arg); } - + return print_expr; - + } - + Expression parse_assert_expression () throws ParseError { var begin = get_location (); - + expect (TokenType.ASSERT); bool parens = accept (TokenType.OPEN_PARENS); var expr = new MemberAccess (null, "assert", get_src (begin)); - + var arg_list = parse_argument_list (); if (parens) { @@ -925,20 +925,20 @@ public class Vala.Genie.Parser : CodeVisitor { } var assert_expr = new MethodCall (expr, get_src (begin)); - + foreach (Expression arg in arg_list) { assert_expr.add_argument (arg); } - + return assert_expr; - + } Expression parse_method_call (SourceLocation begin, Expression inner) throws ParseError { expect (TokenType.OPEN_PARENS); var arg_list = parse_argument_list (); expect (TokenType.CLOSE_PARENS); - + var init_list = parse_object_initializer (); if (init_list.size > 0 && inner is MemberAccess) { @@ -1018,21 +1018,21 @@ public class Vala.Genie.Parser : CodeVisitor { Expression parse_object_or_array_creation_expression () throws ParseError { var begin = get_location (); expect (TokenType.NEW); - + if (accept (TokenType.ARRAY)) { expect (TokenType.OF); var mtype = parse_type (true, false); var expr = parse_array_creation_expression (begin, mtype); return expr; } - + if (accept (TokenType.LIST)) { expect (TokenType.OF); var mtype = parse_type (true, false); var expr = parse_list_creation_expression (begin, mtype); return expr; } - + if (accept (TokenType.DICT)) { expect (TokenType.OF); var mtype1 = parse_type (true, false); @@ -1041,12 +1041,12 @@ public class Vala.Genie.Parser : CodeVisitor { var expr = parse_dict_creation_expression (begin, mtype1, mtype2); return expr; } - - + + var member = parse_member_name (); var expr = parse_object_creation_expression (begin, member); return expr; - + } Expression parse_object_creation_expression (SourceLocation begin, MemberAccess member) throws ParseError { @@ -1058,7 +1058,7 @@ public class Vala.Genie.Parser : CodeVisitor { } else { arg_list = new ArrayList<Expression> (); } - + var init_list = parse_object_initializer (); var expr = new ObjectCreationExpression (member, get_src (begin)); @@ -1076,17 +1076,17 @@ public class Vala.Genie.Parser : CodeVisitor { List<Expression> size_specifier_list = null; bool first = true; DataType etype = element_type.copy (); - + var has_bracket = accept (TokenType.OPEN_BRACKET); - + do { if (!first) { // array of arrays: new T[][42] - + if (size_specified) { throw new ParseError.SYNTAX ("size of inner arrays must not be specified in array creation expression"); } - + etype = new ArrayType (etype, size_specifier_list.size, etype.source_reference); } else { first = false; @@ -1101,7 +1101,7 @@ public class Vala.Genie.Parser : CodeVisitor { } size_specifier_list.add (size); } while (accept (TokenType.COMMA)); - + if (has_bracket) { expect (TokenType.CLOSE_BRACKET); } @@ -1111,7 +1111,7 @@ public class Vala.Genie.Parser : CodeVisitor { if (accept (TokenType.ASSIGN)) { initializer = parse_initializer (); } - + var expr = new ArrayCreationExpression (etype, size_specifier_list.size, initializer, get_src (begin)); if (size_specified) { foreach (Expression size in size_specifier_list) { @@ -1120,38 +1120,38 @@ public class Vala.Genie.Parser : CodeVisitor { } return expr; } - - + + Expression parse_list_creation_expression (SourceLocation begin, DataType element_type) throws ParseError { - + MemberAccess list_member = null, parent_member = null; - + parent_member = new MemberAccess (null, "Gee", get_src (begin)); list_member = new MemberAccess (parent_member, "ArrayList", get_src (begin)); list_member.add_type_argument (element_type); - + list_member.creation_member = true; - + var expr = new ObjectCreationExpression (list_member, get_src (begin)); return expr; } - + Expression parse_dict_creation_expression (SourceLocation begin, DataType key_type, DataType value_type) throws ParseError { - + MemberAccess dict_member = null, parent_member = null; - + parent_member = new MemberAccess (null, "Gee", get_src (begin)); dict_member = new MemberAccess (parent_member, "HashMap", get_src (begin)); dict_member.add_type_argument (key_type); dict_member.add_type_argument (value_type); - + dict_member.creation_member = true; - + var expr = new ObjectCreationExpression (dict_member, get_src (begin)); return expr; } - + List<MemberInitializer> parse_object_initializer () throws ParseError { var list = new ArrayList<MemberInitializer> (); @@ -1238,7 +1238,7 @@ public class Vala.Genie.Parser : CodeVisitor { case TokenType.HASH: if (!context.deprecated) { Report.warning (get_src (begin), "deprecated syntax, use `(owned)` cast"); - } + } next (); var op = parse_unary_expression (); return new ReferenceTransferExpression (op, get_src (begin)); @@ -1299,7 +1299,7 @@ public class Vala.Genie.Parser : CodeVisitor { return new CastExpression.non_null (inner, get_src (begin)); } break; - + default: break; } @@ -1334,7 +1334,7 @@ public class Vala.Genie.Parser : CodeVisitor { case TokenType.OP_LE: return BinaryOperator.LESS_THAN_OR_EQUAL; case TokenType.OP_GE: return BinaryOperator.GREATER_THAN_OR_EQUAL; case TokenType.OP_EQ: return BinaryOperator.EQUALITY; - case TokenType.IS: + case TokenType.IS: next(); if (current () == TokenType.OP_NEG) { prev (); @@ -1582,13 +1582,13 @@ public class Vala.Genie.Parser : CodeVisitor { param.direction = direction; return param; } - + Expression parse_lambda_expression () throws ParseError { var begin = get_location (); List<Parameter> params = new ArrayList<Parameter> (); - + expect (TokenType.DEF); - + if (accept (TokenType.OPEN_PARENS)) { if (current () != TokenType.CLOSE_PARENS) { do { @@ -1609,7 +1609,7 @@ public class Vala.Genie.Parser : CodeVisitor { var expr = parse_expression (); lambda = new LambdaExpression (expr, get_src (begin)); expect_terminator (); - + } @@ -1685,10 +1685,10 @@ public class Vala.Genie.Parser : CodeVisitor { Statement get_for_statement_type () throws ParseError { - + var begin = get_location (); bool is_foreach = false; - + while (current () != TokenType.EOL && current () != TokenType.DO) { next (); if (accept (TokenType.IN)) { @@ -1696,9 +1696,9 @@ public class Vala.Genie.Parser : CodeVisitor { break; } } - + rollback (begin); - + if (is_foreach) { return parse_foreach_statement (); } else { @@ -1717,10 +1717,10 @@ public class Vala.Genie.Parser : CodeVisitor { comment = scanner.pop_comment (); switch (current ()) { - /* skip over requires and ensures as we handled them in method declaration */ + /* skip over requires and ensures as we handled them in method declaration */ case TokenType.REQUIRES: case TokenType.ENSURES: - var begin = get_location (); + var begin = get_location (); next (); if (accept (TokenType.EOL) && accept (TokenType.INDENT)) { @@ -1736,9 +1736,9 @@ public class Vala.Genie.Parser : CodeVisitor { expect (TokenType.EOL); } - + stmt = new EmptyStatement (get_src (begin)); - break; + break; case TokenType.INDENT: @@ -1750,7 +1750,7 @@ public class Vala.Genie.Parser : CodeVisitor { break; case TokenType.PRINT: case TokenType.ASSERT: - stmt = parse_expression_statement (); + stmt = parse_expression_statement (); break; case TokenType.IF: stmt = parse_if_statement (); @@ -1930,7 +1930,7 @@ public class Vala.Genie.Parser : CodeVisitor { } block.source_reference.end = get_current_src ().end; - + return block; } @@ -2054,7 +2054,7 @@ public class Vala.Genie.Parser : CodeVisitor { expect (TokenType.INDENT); while (current () != TokenType.DEDENT) { var section = new SwitchSection (get_src (begin)); - + if (accept (TokenType.WHEN)) { do { section.add_label (new SwitchLabel (parse_expression (), get_src (begin))); @@ -2106,7 +2106,7 @@ public class Vala.Genie.Parser : CodeVisitor { var condition = parse_expression (); expect_terminator (); - + return new DoStatement (body, condition, get_src (begin)); } @@ -2127,7 +2127,7 @@ public class Vala.Genie.Parser : CodeVisitor { is_expr = false; break; default: - + bool local_is_expr = is_expression (); is_expr = local_is_expr; break; @@ -2149,7 +2149,7 @@ public class Vala.Genie.Parser : CodeVisitor { expect (TokenType.COLON); variable_type = parse_type (true, true); } - + DataType type_copy = null; if (variable_type != null) { type_copy = variable_type.copy (); @@ -2158,18 +2158,18 @@ public class Vala.Genie.Parser : CodeVisitor { block.add_statement (new DeclarationStatement (local, local.source_reference)); } - - - + + + if (accept (TokenType.TO)) { - /* create expression for condition and incrementing iterator */ + /* create expression for condition and incrementing iterator */ var to_begin = get_location (); var to_src = get_src (to_begin); var left = new MemberAccess (null, id, to_src); var right = parse_primary_expression (); condition = new BinaryExpression (BinaryOperator.LESS_THAN_OR_EQUAL, left, right, to_src); - + iterator = new PostfixExpression (left, true, to_src); } else { expect (TokenType.DOWNTO); @@ -2254,7 +2254,7 @@ public class Vala.Genie.Parser : CodeVisitor { } else { expect_terminator (); } - return new ReturnStatement (expr, get_src (begin)); + return new ReturnStatement (expr, get_src (begin)); } Statement parse_yield_statement () throws ParseError { @@ -2312,7 +2312,7 @@ public class Vala.Genie.Parser : CodeVisitor { expect (TokenType.COLON); type = parse_type (true, true); expect (TokenType.EOL); - + } var block = parse_block (); catch_clauses.add (new CatchClause (type, id, block, get_src (begin))); @@ -2394,7 +2394,7 @@ public class Vala.Genie.Parser : CodeVisitor { expect (TokenType.CLOSE_BRACKET); } if (!parameter) - expect (TokenType.EOL); + expect (TokenType.EOL); return attrs; } @@ -2413,10 +2413,10 @@ public class Vala.Genie.Parser : CodeVisitor { comment = scanner.pop_comment (); var attrs = parse_attributes (false); var begin = get_location (); - + switch (current ()) { case TokenType.CONST: - return parse_constant_declaration (attrs); + return parse_constant_declaration (attrs); case TokenType.CONSTRUCT: return parse_creation_method_declaration (attrs); case TokenType.CLASS: @@ -2427,8 +2427,8 @@ public class Vala.Genie.Parser : CodeVisitor { } rollback (begin); return parse_constructor_declaration (attrs); - case TokenType.DELEGATE: - return parse_delegate_declaration (attrs); + case TokenType.DELEGATE: + return parse_delegate_declaration (attrs); case TokenType.DEF: return parse_method_declaration (attrs); case TokenType.ENUM: @@ -2437,18 +2437,18 @@ public class Vala.Genie.Parser : CodeVisitor { return parse_errordomain_declaration (attrs); case TokenType.FINAL: return parse_destructor_declaration (attrs); - case TokenType.INTERFACE: - return parse_interface_declaration (attrs); - case TokenType.NAMESPACE: - return parse_namespace_declaration (attrs); - case TokenType.PROP: + case TokenType.INTERFACE: + return parse_interface_declaration (attrs); + case TokenType.NAMESPACE: + return parse_namespace_declaration (attrs); + case TokenType.PROP: return parse_property_declaration (attrs); - case TokenType.EVENT: + case TokenType.EVENT: return parse_signal_declaration (attrs); - case TokenType.STRUCT: + case TokenType.STRUCT: return parse_struct_declaration (attrs); - default: - + default: + while (current () != TokenType.EOL && current () != TokenType.SEMICOLON && current () != TokenType.EOF) { if (current () == TokenType.COLON) { rollback (begin); @@ -2458,10 +2458,10 @@ public class Vala.Genie.Parser : CodeVisitor { } } rollback (begin); - - break; + + break; } - + TokenType cur = current (); TokenType pre = tokens[index-1].type; @@ -2568,7 +2568,7 @@ public class Vala.Genie.Parser : CodeVisitor { set_attributes (ns, attrs); expect (TokenType.EOL); parse_declarations (ns); - + Namespace result = ns; while (sym.inner != null) { sym = sym.inner; @@ -2620,7 +2620,7 @@ public class Vala.Genie.Parser : CodeVisitor { var begin = get_location (); var sym = parse_symbol_name (); var ns_ref = new UsingDirective (sym, get_src (begin)); - + scanner.source_file.add_using_directive (ns_ref); ns.add_using_directive (ns_ref); } @@ -2632,19 +2632,19 @@ public class Vala.Genie.Parser : CodeVisitor { while (current () != TokenType.DEDENT && current () != TokenType.EOF) { add_uses_clause (ns); - expect (TokenType.EOL); + expect (TokenType.EOL); } expect (TokenType.DEDENT); } else { do { - add_uses_clause (ns); + add_uses_clause (ns); } while (accept (TokenType.COMMA)); expect_terminator (); } } - + } Symbol parse_class_declaration (List<Attribute>? attrs) throws ParseError { @@ -2659,7 +2659,7 @@ public class Vala.Genie.Parser : CodeVisitor { if (accept (TokenType.COLON)) { var type1 = parse_type (true, false); base_types.add (type1); - + if (accept (TokenType.IMPLEMENTS)) { do { var type2 = parse_type (true, true); @@ -2792,7 +2792,7 @@ public class Vala.Genie.Parser : CodeVisitor { var flags = parse_member_declaration_modifiers (); string id = parse_identifier (); - + expect (TokenType.COLON); var type = parse_type (false, false); type = parse_inline_array_type (type); @@ -2811,14 +2811,14 @@ public class Vala.Genie.Parser : CodeVisitor { var c = new Constant (id, type, initializer, get_src (begin), comment); c.access = get_access (id); - + if (ModifierFlags.EXTERN in flags || scanner.source_file.file_type == SourceFileType.PACKAGE) { c.external = true; } if (ModifierFlags.NEW in flags) { c.hides = true; } - + set_attributes (c, attrs); if (ModifierFlags.STATIC in flags) { @@ -2836,10 +2836,10 @@ public class Vala.Genie.Parser : CodeVisitor { var flags = parse_member_declaration_modifiers (); var type = parse_type (true, true); - + type = parse_inline_array_type (type); - var f = new Field (id, type, null, get_src (begin), comment); + var f = new Field (id, type, null, get_src (begin), comment); if (ModifierFlags.ABSTRACT in flags || ModifierFlags.VIRTUAL in flags || ModifierFlags.OVERRIDE in flags) { Report.error (f.source_reference, "abstract, virtual, and override modifiers are not applicable to fields"); @@ -2892,9 +2892,9 @@ public class Vala.Genie.Parser : CodeVisitor { } return initializer; } - - - + + + Method parse_main_method_declaration (List<Attribute>? attrs) throws ParseError { var id = "main"; @@ -2904,27 +2904,27 @@ public class Vala.Genie.Parser : CodeVisitor { var method = new Method (id, type, get_src (begin), comment); method.access = SymbolAccessibility.PUBLIC; - + set_attributes (method, attrs); method.binding = MemberBinding.STATIC; - + var sym = new UnresolvedSymbol (null, "string", get_src (begin)); type = new UnresolvedType.from_symbol (sym, get_src (begin)); type.value_owned = true; type = new ArrayType (type, 1, get_src (begin)); type.nullable = false; - + var param = new Parameter ("args", type, get_src (begin)); method.add_parameter (param); - - + + expect (TokenType.EOL); if (accept_block ()) { method.body = parse_block (); } - + return method; } @@ -2953,10 +2953,10 @@ public class Vala.Genie.Parser : CodeVisitor { if (accept (TokenType.COLON)) { type = parse_type (true, false); } - + var type_param_list = parse_type_parameter_list (); - var method = new Method (id, type, get_src (begin), comment); + var method = new Method (id, type, get_src (begin), comment); if (ModifierFlags.PRIVATE in flags) { method.access = SymbolAccessibility.PRIVATE; } else { @@ -2969,7 +2969,7 @@ public class Vala.Genie.Parser : CodeVisitor { foreach (TypeParameter type_param in type_param_list) { method.add_type_parameter (type_param); } - + foreach (Parameter param in params) { method.add_parameter (param); @@ -2990,7 +2990,7 @@ public class Vala.Genie.Parser : CodeVisitor { if (ModifierFlags.ASYNC in flags) { method.coroutine = true; } - + if (ModifierFlags.NEW in flags) { method.hides = true; } @@ -3031,24 +3031,24 @@ public class Vala.Genie.Parser : CodeVisitor { /* "requires" and "ensures" if present will be at start of the method body */ - if (accept (TokenType.INDENT)) { + if (accept (TokenType.INDENT)) { if (accept (TokenType.REQUIRES)) { - + if (accept (TokenType.EOL) && accept (TokenType.INDENT)) { while (current() != TokenType.DEDENT) { method.add_precondition (parse_expression ()); expect (TokenType.EOL); } - + expect (TokenType.DEDENT); accept_terminator (); } else { - + method.add_precondition (parse_expression ()); expect_terminator (); - + } - + } if (accept (TokenType.ENSURES)) { @@ -3101,7 +3101,7 @@ public class Vala.Genie.Parser : CodeVisitor { } set_attributes (prop, attrs); - + if (ModifierFlags.STATIC in flags) { prop.binding = MemberBinding.STATIC; } else if (ModifierFlags.CLASS in flags) { @@ -3116,14 +3116,14 @@ public class Vala.Genie.Parser : CodeVisitor { if (ModifierFlags.OVERRIDE in flags) { prop.overrides = true; } - + if (ModifierFlags.NEW in flags) { prop.hides = true; } if (ModifierFlags.EXTERN in flags || scanner.source_file.file_type == SourceFileType.PACKAGE) { prop.external = true; } - + if (ModifierFlags.ASYNC in flags) { Report.error (prop.source_reference, "async properties are not supported yet"); } @@ -3196,7 +3196,7 @@ public class Vala.Genie.Parser : CodeVisitor { prop.set_accessor = new PropertyAccessor (false, true, false, value_type, null, get_src (begin)); prop.set_accessor.access = SymbolAccessibility.PUBLIC; - + } expect_terminator (); @@ -3206,7 +3206,7 @@ public class Vala.Genie.Parser : CodeVisitor { var needs_var = (readonly && (prop.get_accessor != null && prop.get_accessor.body == null)); if (!needs_var) { - needs_var = (prop.get_accessor != null && prop.get_accessor.body == null) || (prop.set_accessor != null && prop.set_accessor.body == null); + needs_var = (prop.get_accessor != null && prop.get_accessor.body == null) || (prop.set_accessor != null && prop.set_accessor.body == null); } if (needs_var) { @@ -3260,7 +3260,7 @@ public class Vala.Genie.Parser : CodeVisitor { if (ModifierFlags.NEW in flags) { sig.hides = true; } - + if (ModifierFlags.STATIC in flags) { throw new ParseError.SYNTAX ("`static' modifier not allowed on signals"); } else if (ModifierFlags.CLASS in flags) { @@ -3359,7 +3359,7 @@ public class Vala.Genie.Parser : CodeVisitor { } else if (sym is Constant) { st.add_constant ((Constant) sym); } else if (sym is Property) { - st.add_property ((Property) sym); + st.add_property ((Property) sym); } else { Report.error (sym.source_reference, "unexpected declaration in struct"); } @@ -3399,9 +3399,9 @@ public class Vala.Genie.Parser : CodeVisitor { expect (TokenType.EOL); - + parse_declarations (iface); - + Symbol result = iface; while (sym.inner != null) { @@ -3467,7 +3467,7 @@ public class Vala.Genie.Parser : CodeVisitor { break; } var value_attrs = parse_attributes (false); - var value_begin = get_location (); + var value_begin = get_location (); string id = parse_identifier (); comment = scanner.pop_comment (); @@ -3485,7 +3485,7 @@ public class Vala.Genie.Parser : CodeVisitor { accept (TokenType.EOL); } } while (true); - + expect (TokenType.DEDENT); Symbol result = en; @@ -3537,15 +3537,15 @@ public class Vala.Genie.Parser : CodeVisitor { ed.add_code (ec); accept (TokenType.EOL); } while (true); - - + + expect (TokenType.DEDENT); Symbol result = ed; while (sym.inner != null) { sym = sym.inner; var ns = new Namespace (sym.name, ed.source_reference); - + if (result is Namespace) { ns.add_namespace ((Namespace) result); } else { @@ -3597,7 +3597,7 @@ public class Vala.Genie.Parser : CodeVisitor { case TokenType.ASYNC: next (); flags |= ModifierFlags.ASYNC; - break; + break; case TokenType.CLASS: next (); flags |= ModifierFlags.CLASS; @@ -3613,7 +3613,7 @@ public class Vala.Genie.Parser : CodeVisitor { case TokenType.NEW: next (); flags |= ModifierFlags.NEW; - break; + break; case TokenType.OVERRIDE: next (); flags |= ModifierFlags.OVERRIDE; @@ -3621,7 +3621,7 @@ public class Vala.Genie.Parser : CodeVisitor { case TokenType.SEALED: next (); flags |= ModifierFlags.SEALED; - break; + break; case TokenType.STATIC: next (); flags |= ModifierFlags.STATIC; @@ -3693,7 +3693,7 @@ public class Vala.Genie.Parser : CodeVisitor { } else { var sym = parse_symbol_name (); if (sym.inner == null) { - + if (sym.name != class_name) { method = new CreationMethod (class_name, sym.name, get_src (begin), comment); } else { @@ -3726,7 +3726,7 @@ public class Vala.Genie.Parser : CodeVisitor { } else if (scanner.source_file.file_type == SourceFileType.PACKAGE) { method.external = true; } - + return method; } @@ -3741,7 +3741,7 @@ public class Vala.Genie.Parser : CodeVisitor { var sym = parse_symbol_name (); var type_param_list = parse_type_parameter_list (); - + if (ModifierFlags.NEW in flags) { throw new ParseError.SYNTAX ("`new' modifier not allowed on delegates"); } @@ -3759,7 +3759,7 @@ public class Vala.Genie.Parser : CodeVisitor { if (accept (TokenType.COLON)) { type = parse_type (true, false); - + } else { type = new VoidType (); } @@ -3774,7 +3774,7 @@ public class Vala.Genie.Parser : CodeVisitor { expect_terminator (); - + if (ModifierFlags.PRIVATE in flags) { d.access = SymbolAccessibility.PRIVATE; } else { @@ -3847,7 +3847,7 @@ public class Vala.Genie.Parser : CodeVisitor { } } - + // try to parse type argument list List<DataType>? parse_type_argument_list (bool maybe_expression) throws ParseError { var begin = get_location (); @@ -3860,7 +3860,7 @@ public class Vala.Genie.Parser : CodeVisitor { if (accept (TokenType.OPEN_PARENS)) { inParens = true; } - + do { switch (current ()) { case TokenType.VOID: @@ -3877,7 +3877,7 @@ public class Vala.Genie.Parser : CodeVisitor { return null; } } while (accept (TokenType.COMMA)); - + if (inParens) { expect (TokenType.CLOSE_PARENS); } diff --git a/vala/valageniescanner.vala b/vala/valageniescanner.vala index e232a77bc..177f2b027 100644 --- a/vala/valageniescanner.vala +++ b/vala/valageniescanner.vala @@ -34,14 +34,14 @@ public class Vala.Genie.Scanner { char* begin; char* current; char* end; - + int line; int column; int current_indent_level; int indent_level; int pending_dedents; - + /* track open parens and braces for automatic line continuations */ int open_parens_count; int open_brace_count; @@ -50,7 +50,7 @@ public class Vala.Genie.Scanner { bool parse_started; Comment _comment; - + Conditional[] conditional_stack; struct Conditional { @@ -69,7 +69,7 @@ public class Vala.Genie.Scanner { TEMPLATE, TEMPLATE_PART } - + public Scanner (SourceFile source_file) { this.source_file = source_file; @@ -84,13 +84,13 @@ public class Vala.Genie.Scanner { current_indent_level = 0; indent_level = 0; pending_dedents = 0; - + open_parens_count = 0; open_brace_count = 0; parse_started = false; last_token = TokenType.NONE; - + } bool in_template () { @@ -104,7 +104,7 @@ public class Vala.Genie.Scanner { bool is_ident_char (char c) { return (c.isalnum () || c == '_'); } - + bool in_regex_literal () { return (state_stack.length > 0 && state_stack[state_stack.length - 1] == State.REGEX_LITERAL); } @@ -273,7 +273,7 @@ public class Vala.Genie.Scanner { return type; } - + public void seek (SourceLocation location) { current = location.pos; line = location.line; @@ -305,7 +305,7 @@ public class Vala.Genie.Scanner { break; case 'o': if (matches (begin, "of")) return TokenType.OF; - + if (matches (begin, "or")) return TokenType.OP_OR; break; case 't': @@ -388,7 +388,7 @@ public class Vala.Genie.Scanner { break; } break; - + case 'n': if (matches (begin, "null")) return TokenType.NULL; break; @@ -659,7 +659,7 @@ public class Vala.Genie.Scanner { return TokenType.IDENTIFIER; } - + public TokenType read_template_token (out SourceLocation token_begin, out SourceLocation token_end) { TokenType type; char* begin = current; @@ -816,22 +816,22 @@ public class Vala.Genie.Scanner { /* scrub whitespace (excluding newlines) and comments */ space (); } - - + + /* handle explicit line continuation (lines ending with "\") */ while (current < end && current[0] == '\\' && current[1] == '\n') { current += 2; line++; skip_space_tabs (); } - + /* handle automatic line continuations (when inside parens or braces) */ while (current < end && current[0] == '\n' && (open_parens_count > 0 || open_brace_count > 0)) { current++; line++; skip_space_tabs (); } - + /* handle non-consecutive new line once parsing is underway - EOL */ if (newline () && parse_started && last_token != TokenType.EOL && last_token != TokenType.SEMICOLON) { @@ -1347,7 +1347,7 @@ public class Vala.Genie.Scanner { int count_tabs () { - + int tab_count = 0; @@ -1364,9 +1364,9 @@ public class Vala.Genie.Scanner { column++; space_count++; } - + tab_count = space_count / _indent_spaces; - + } /* ignore comments and whitspace and other lines that contain no code */ @@ -1392,17 +1392,17 @@ public class Vala.Genie.Scanner { bool whitespace () { bool found = false; while (current < end && current[0].isspace () && current[0] != '\n' ) { - + found = true; current++; column++; } - + if ((column == 1) && (current < end) && (current[0] == '#')) { pp_directive (); return true; } - + return found; } @@ -1441,12 +1441,12 @@ public class Vala.Genie.Scanner { if (current[1] == '/') { // single-line comment - + SourceReference source_reference = null; if (file_comment) { source_reference = get_source_reference (0); } - + current += 2; // skip until end of line or end of file @@ -1461,11 +1461,11 @@ public class Vala.Genie.Scanner { column = 1; current_indent_level = 0; } - + if (source_reference != null) { push_comment (((string) begin).substring (0, (long) (current - begin)), source_reference, file_comment); } - + } else { // delimited comment SourceReference source_reference = null; @@ -1513,14 +1513,14 @@ public class Vala.Genie.Scanner { column++; found = true; } - + return found; } void skip_space_tabs () { while (whitespace () || skip_tabs () || comment () ) { } - + } void space () { @@ -1531,7 +1531,7 @@ public class Vala.Genie.Scanner { public void parse_file_comments () { while (whitespace () || comment (true)) { } - + } void push_comment (string comment_item, SourceReference source_reference, bool file_comment) { diff --git a/vala/valagenietokentype.vala b/vala/valagenietokentype.vala index 2f4af90ef..bc7bea24a 100644 --- a/vala/valagenietokentype.vala +++ b/vala/valagenietokentype.vala @@ -253,7 +253,7 @@ public enum Vala.Genie.TokenType { case NAMESPACE: return "`namespace'"; case NEW: return "`new'"; case NULL: return "`null'"; - case OF: return "`of'"; + case OF: return "`of'"; case OUT: return "`out'"; case OP_AND: return "`and'"; case OP_DEC: return "`--'"; diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 65ab2d940..24d1ea50f 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -541,7 +541,7 @@ public class Vala.GirParser : CodeVisitor { public Node (string? name) { this.name = name; } - + public void add_member (Node node) { var nodes = scope[node.name]; if (nodes == null) { @@ -852,7 +852,7 @@ public class Vala.GirParser : CodeVisitor { } } } - + if (symbol is Class && girdata != null) { var class_struct = girdata["glib:type-struct"]; if (class_struct != null) { @@ -1015,7 +1015,7 @@ public class Vala.GirParser : CodeVisitor { } } } - + prop.get_accessor.value_type.value_owned = m.return_type.value_owned; if (!m.is_abstract && !m.is_virtual && prop.is_abstract) { @@ -1055,7 +1055,7 @@ public class Vala.GirParser : CodeVisitor { var base_prop_node = parser.base_interface_property (this); if (base_prop_node != null) { base_prop_node.process (parser); - + var base_property = (Property) base_prop_node.symbol; if (base_property.get_attribute ("ConcreteAccessor") != null) { prop.set_attribute ("NoAccessorMethod", false); @@ -1065,7 +1065,7 @@ public class Vala.GirParser : CodeVisitor { if (prop.set_accessor != null) { prop.set_accessor.value_type.value_owned = base_property.set_accessor.value_type.value_owned; } - + } } } @@ -1856,7 +1856,7 @@ public class Vala.GirParser : CodeVisitor { } return type_id; } - + void set_array_ccode (Symbol sym, ParameterInfo info) { sym.set_attribute_double ("CCode", "array_length_pos", info.vala_idx); if (sym is Parameter) { @@ -3673,24 +3673,24 @@ public class Vala.GirParser : CodeVisitor { base_node.process (this); orig = (Delegate) base_node.symbol; } - + var deleg = new Delegate (alias.name, orig.return_type.copy (), alias.source_reference); deleg.access = orig.access; - + foreach (var param in orig.get_parameters ()) { deleg.add_parameter (param.copy ()); } - + foreach (var error_type in orig.get_error_types ()) { deleg.add_error_type (error_type.copy ()); } - + foreach (var attribute in orig.attributes) { deleg.attributes.append (attribute); } - + deleg.external = true; - + alias.symbol = deleg; } @@ -3709,7 +3709,7 @@ public class Vala.GirParser : CodeVisitor { // processed in parse_alias return; } - + var s = node.symbol; List<ParameterInfo> parameters = node.parameters; diff --git a/vala/valaifstatement.vala b/vala/valaifstatement.vala index 7655ffd15..0f9476d36 100644 --- a/vala/valaifstatement.vala +++ b/vala/valaifstatement.vala @@ -38,7 +38,7 @@ public class Vala.IfStatement : CodeNode, Statement { _condition.parent_node = this; } } - + /** * The statement to be evaluated if the condition holds. */ @@ -49,7 +49,7 @@ public class Vala.IfStatement : CodeNode, Statement { _true_statement.parent_node = this; } } - + /** * The optional statement to be evaluated if the condition doesn't hold. */ @@ -80,16 +80,16 @@ public class Vala.IfStatement : CodeNode, Statement { false_statement = false_stmt; source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_if_statement (this); } public override void accept_children (CodeVisitor visitor) { condition.accept (visitor); - + visitor.visit_end_full_expression (condition); - + true_statement.accept (visitor); if (false_statement != null) { false_statement.accept (visitor); diff --git a/vala/valainitializerlist.vala b/vala/valainitializerlist.vala index 9a18b71e1..8a601874e 100644 --- a/vala/valainitializerlist.vala +++ b/vala/valainitializerlist.vala @@ -29,9 +29,9 @@ using GLib; */ public class Vala.InitializerList : Expression { private List<Expression> initializers = new ArrayList<Expression> (); - + /** - * Appends the specified expression to this initializer + * Appends the specified expression to this initializer * * @param expr an expression */ @@ -39,9 +39,9 @@ public class Vala.InitializerList : Expression { initializers.add (expr); expr.parent_node = this; } - + /** - * Returns a copy of the expression + * Returns a copy of the expression * * @return expression list */ @@ -50,14 +50,14 @@ public class Vala.InitializerList : Expression { } /** - * Returns the initializer count in this initializer + * Returns the initializer count in this initializer */ public int size { get { return initializers.size; } } /** - * Creates a new initializer + * Creates a new initializer * * @param source_reference reference to source code * @return newly created initializer list diff --git a/vala/valaintegerliteral.vala b/vala/valaintegerliteral.vala index 3a1d6734c..76b0ac0b0 100644 --- a/vala/valaintegerliteral.vala +++ b/vala/valaintegerliteral.vala @@ -44,7 +44,7 @@ public class Vala.IntegerLiteral : Literal { value = i; source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_integer_literal (this); @@ -77,7 +77,7 @@ public class Vala.IntegerLiteral : Literal { u = true; value = value.substring (0, value.length - 1); } - + int64 n = int64.parse (value); if (!u && (n > int.MAX || n < int.MIN)) { // value doesn't fit into signed 32-bit diff --git a/vala/valainterface.vala b/vala/valainterface.vala index 72d345476..adb41ae16 100644 --- a/vala/valainterface.vala +++ b/vala/valainterface.vala @@ -70,7 +70,7 @@ public class Vala.Interface : ObjectTypeSymbol { public List<DataType> get_prerequisites () { return prerequisites; } - + /** * Adds the specified method as a member to this interface. * @@ -79,7 +79,7 @@ public class Vala.Interface : ObjectTypeSymbol { public override void add_method (Method m) { if (m is CreationMethod) { Report.error (m.source_reference, "construction methods may only be declared within classes and structs"); - + m.error = true; return; } @@ -113,7 +113,7 @@ public class Vala.Interface : ObjectTypeSymbol { prop.this_parameter = new Parameter ("this", new ObjectType (this)); prop.scope.add (prop.this_parameter.name, prop.this_parameter); } - + public virtual List<Symbol> get_virtuals () { return virtuals; } @@ -139,7 +139,7 @@ public class Vala.Interface : ObjectTypeSymbol { foreach (Method m in get_methods ()) { m.accept (visitor); } - + foreach (Field f in get_fields ()) { f.accept (visitor); } @@ -151,15 +151,15 @@ public class Vala.Interface : ObjectTypeSymbol { foreach (Property prop in get_properties ()) { prop.accept (visitor); } - + foreach (Signal sig in get_signals ()) { sig.accept (visitor); } - + foreach (Class cl in get_classes ()) { cl.accept (visitor); } - + foreach (Struct st in get_structs ()) { st.accept (visitor); } @@ -172,7 +172,7 @@ public class Vala.Interface : ObjectTypeSymbol { public override bool is_reference_type () { return true; } - + public override bool is_subtype_of (TypeSymbol t) { if (this == t) { return true; @@ -183,10 +183,10 @@ public class Vala.Interface : ObjectTypeSymbol { return true; } } - + return false; } - + public override void replace_type (DataType old_type, DataType new_type) { for (int i = 0; i < prerequisites.size; i++) { if (prerequisites[i] == old_type) { diff --git a/vala/valainterfacetype.vala b/vala/valainterfacetype.vala index 3ca1a2c85..6187044d1 100644 --- a/vala/valainterfacetype.vala +++ b/vala/valainterfacetype.vala @@ -42,11 +42,11 @@ public class Vala.InterfaceType : ReferenceType { result.nullable = nullable; result.is_dynamic = is_dynamic; result.floating_reference = floating_reference; - + foreach (DataType arg in get_type_arguments ()) { result.add_type_argument (arg.copy ()); } - + return result; } } diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala index a3ee20a2f..3223e747a 100644 --- a/vala/valalambdaexpression.vala +++ b/vala/valalambdaexpression.vala @@ -34,13 +34,13 @@ public class Vala.LambdaExpression : Expression { * expression_body or statement_body may be set. */ public Expression expression_body { get; set; } - + /** * The statement body of this lambda expression. Only one of * expression_body or statement_body may be set. */ public Block statement_body { get; set; } - + /** * The generated method. */ @@ -59,7 +59,7 @@ public class Vala.LambdaExpression : Expression { this.source_reference = source_reference; this.expression_body = expression_body; } - + /** * Creates a new lambda expression with statement body. * @@ -71,7 +71,7 @@ public class Vala.LambdaExpression : Expression { this.statement_body = statement_body; this.source_reference = source_reference; } - + /** * Appends implicitly typed parameter. * @@ -80,7 +80,7 @@ public class Vala.LambdaExpression : Expression { public void add_parameter (Parameter param) { parameters.add (param); } - + /** * Returns copy of parameter list. * @@ -89,7 +89,7 @@ public class Vala.LambdaExpression : Expression { public List<Parameter> get_parameters () { return parameters; } - + public override void accept (CodeVisitor visitor) { visitor.visit_lambda_expression (this); diff --git a/vala/valalocalvariable.vala b/vala/valalocalvariable.vala index c11380700..22d7c6991 100644 --- a/vala/valalocalvariable.vala +++ b/vala/valalocalvariable.vala @@ -43,7 +43,7 @@ public class Vala.LocalVariable : Variable { public LocalVariable (DataType? variable_type, string name, Expression? initializer = null, SourceReference? source_reference = null) { base (variable_type, name, initializer, source_reference); } - + public override void accept (CodeVisitor visitor) { visitor.visit_local_variable (this); } @@ -51,10 +51,10 @@ public class Vala.LocalVariable : Variable { public override void accept_children (CodeVisitor visitor) { if (initializer != null) { initializer.accept (visitor); - + visitor.visit_end_full_expression (initializer); } - + if (variable_type != null) { variable_type.accept (visitor); } diff --git a/vala/valalockable.vala b/vala/valalockable.vala index 8d738125c..0cbf063cb 100644 --- a/vala/valalockable.vala +++ b/vala/valalockable.vala @@ -31,7 +31,7 @@ public interface Vala.Lockable { * Indicates a specific lockable object beeing actually locked somewhere. */ public abstract bool get_lock_used (); - + /** * Set this lockable object as beeing locked somewhere. */ diff --git a/vala/valalockstatement.vala b/vala/valalockstatement.vala index e0d4216f9..ad15d063b 100644 --- a/vala/valalockstatement.vala +++ b/vala/valalockstatement.vala @@ -37,18 +37,18 @@ public class Vala.LockStatement : CodeNode, Statement { * Expression representing the resource to be locked. */ public Expression resource { get; set; } - + /** * The statement during its execution the resource is locked. */ public Block? body { get; set; } - + public LockStatement (Expression resource, Block? body, SourceReference? source_reference = null) { this.body = body; this.source_reference = source_reference; this.resource = resource; } - + public override void accept (CodeVisitor visitor) { resource.accept (visitor); if (body != null) { diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala index 85f8bbb63..a5e056f46 100644 --- a/vala/valamemberaccess.vala +++ b/vala/valamemberaccess.vala @@ -40,7 +40,7 @@ public class Vala.MemberAccess : Expression { } } } - + /** * The name of the member. */ @@ -69,7 +69,7 @@ public class Vala.MemberAccess : Expression { private Expression? _inner; private List<DataType> type_argument_list = new ArrayList<DataType> (); - + /** * Creates a new member access expression. * @@ -105,7 +105,7 @@ public class Vala.MemberAccess : Expression { type_argument_list.add (arg); arg.parent_node = this; } - + /** * Returns a copy of the list of generic type arguments. * @@ -125,7 +125,7 @@ public class Vala.MemberAccess : Expression { if (inner != null) { inner.accept (visitor); } - + foreach (DataType type_arg in type_argument_list) { type_arg.accept (visitor); } @@ -203,7 +203,7 @@ public class Vala.MemberAccess : Expression { if (inner != null) { inner.check (context); } - + foreach (DataType type_arg in type_argument_list) { type_arg.check (context); } diff --git a/vala/valamemberinitializer.vala b/vala/valamemberinitializer.vala index 352b1ffa4..436423aa5 100644 --- a/vala/valamemberinitializer.vala +++ b/vala/valamemberinitializer.vala @@ -63,11 +63,11 @@ public class Vala.MemberInitializer : CodeNode { this.source_reference = source_reference; this.name = name; } - + public override void accept (CodeVisitor visitor) { initializer.accept (visitor); } - + public override bool check (CodeContext context) { return initializer.check (context); } diff --git a/vala/valamethod.vala b/vala/valamethod.vala index a2bd57c45..1adfeabfd 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -50,26 +50,26 @@ public class Vala.Method : Subroutine, Callable { * the contained type. */ public MemberBinding binding { get; set; default = MemberBinding.INSTANCE; } - + /** * Specifies whether this method is abstract. Abstract methods have no * body, may only be specified within abstract classes, and must be * overriden by derived non-abstract classes. */ public bool is_abstract { get; set; } - + /** * Specifies whether this method is virtual. Virtual methods may be * overridden by derived classes. */ public bool is_virtual { get; set; } - + /** * Specifies whether this method overrides a virtual or abstract method * of a base type. */ public bool overrides { get; set; } - + /** * Specifies whether this method should be inlined. */ @@ -100,7 +100,7 @@ public class Vala.Method : Subroutine, Callable { /** * Specifies the virtual or abstract method this method overrides. - * Reference must be weak as virtual and abstract methods set + * Reference must be weak as virtual and abstract methods set * base_method to themselves. */ public Method base_method { @@ -225,7 +225,7 @@ public class Vala.Method : Subroutine, Callable { parameters.add (param); scope.add (param.name, param); } - + public List<Parameter> get_parameters () { return parameters; } @@ -350,7 +350,7 @@ public class Vala.Method : Subroutine, Callable { invalid_match = "Base method expected return type `%s', but `%s' was provided".printf (actual_base_type.to_prototype_string (), return_type.to_prototype_string ()); return false; } - + Iterator<Parameter> method_params_it = parameters.iterator (); int param_index = 1; foreach (Parameter base_param in base_method.parameters) { @@ -379,7 +379,7 @@ public class Vala.Method : Subroutine, Callable { } param_index++; } - + /* this method may not expect more arguments */ if (method_params_it.next ()) { invalid_match = "too many parameters"; @@ -603,7 +603,7 @@ public class Vala.Method : Subroutine, Callable { continue; } } - + string invalid_match = null; if (!compatible (base_method, out invalid_match)) { error = true; @@ -611,7 +611,7 @@ public class Vala.Method : Subroutine, Callable { Report.error (source_reference, "overriding method `%s' is incompatible with base method `%s': %s.".printf (get_full_name (), base_method_type.to_prototype_string (), invalid_match)); return; } - + _base_interface_method = base_method; return; } @@ -841,7 +841,7 @@ public class Vala.Method : Subroutine, Callable { } // check that all errors that can be thrown in the method body are declared - if (body != null) { + if (body != null) { foreach (DataType body_error_type in body.get_error_types ()) { bool can_propagate_error = false; foreach (DataType method_error_type in get_error_types ()) { @@ -932,19 +932,19 @@ public class Vala.Method : Subroutine, Callable { return false; } } - + if (binding == MemberBinding.INSTANCE) { // method must be static return false; } - + if (return_type is VoidType) { } else if (return_type.data_type == context.analyzer.int_type.data_type) { } else { // return type must be void or int return false; } - + var params = get_parameters (); if (params.size == 0) { // method may have no parameters @@ -955,7 +955,7 @@ public class Vala.Method : Subroutine, Callable { // method must not have more than one parameter return false; } - + Iterator<Parameter> params_it = params.iterator (); params_it.next (); var param = params_it.get (); @@ -964,18 +964,18 @@ public class Vala.Method : Subroutine, Callable { // parameter must not be an out parameter return false; } - + if (!(param.variable_type is ArrayType)) { // parameter must be an array return false; } - + var array_type = (ArrayType) param.variable_type; if (array_type.element_type.data_type != context.analyzer.string_type.data_type) { // parameter must be an array of strings return false; } - + return true; } diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index 415191ab6..cc6a3fcda 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -49,7 +49,7 @@ public class Vala.MethodCall : Expression { public bool is_chainup { get; private set; } private Expression _call; - + private List<Expression> argument_list = new ArrayList<Expression> (); /** @@ -63,7 +63,7 @@ public class Vala.MethodCall : Expression { this.source_reference = source_reference; this.call = call; } - + /** * Appends the specified expression to the list of arguments. * @@ -73,7 +73,7 @@ public class Vala.MethodCall : Expression { argument_list.add (arg); arg.parent_node = this; } - + /** * Returns a copy of the argument list. * @@ -101,7 +101,7 @@ public class Vala.MethodCall : Expression { if (call == old_node) { call = new_node; } - + int index = argument_list.index_of (old_node); if (index >= 0 && new_node.parent_node == null) { argument_list[index] = new_node; diff --git a/vala/valamethodtype.vala b/vala/valamethodtype.vala index 2f2894e85..063189f6e 100644 --- a/vala/valamethodtype.vala +++ b/vala/valamethodtype.vala @@ -54,7 +54,7 @@ public class Vala.MethodType : CallableType { // method types incompatible to anything but delegates return false; } - + return dt.delegate_symbol.matches_method (method_symbol, dt); } diff --git a/vala/valanamespace.vala b/vala/valanamespace.vala index 47dd4eee1..af062f85c 100644 --- a/vala/valanamespace.vala +++ b/vala/valanamespace.vala @@ -139,7 +139,7 @@ public class Vala.Namespace : Symbol { scope.add (ns.name, ns); } } - + /** * Returns a copy of the list of namespaces. * @@ -148,7 +148,7 @@ public class Vala.Namespace : Symbol { public List<Namespace> get_namespaces () { return namespaces; } - + /** * Adds the specified class to this namespace. * @@ -187,7 +187,7 @@ public class Vala.Namespace : Symbol { scope.add (iface.name, iface); } - + /** * Adds the specified struct to this namespace. * @@ -206,7 +206,7 @@ public class Vala.Namespace : Symbol { structs.add (st); scope.add (st.name, st); } - + /** * Removes the specified struct from this namespace. * @@ -216,7 +216,7 @@ public class Vala.Namespace : Symbol { structs.remove (st); scope.remove (st.name); } - + /** * Adds the specified enum to this namespace. * @@ -291,7 +291,7 @@ public class Vala.Namespace : Symbol { public List<Class> get_classes () { return classes; } - + /** * Returns a copy of the list of interfaces. * @@ -300,7 +300,7 @@ public class Vala.Namespace : Symbol { public List<Interface> get_interfaces () { return interfaces; } - + /** * Returns a copy of the list of enums. * @@ -309,7 +309,7 @@ public class Vala.Namespace : Symbol { public List<Enum> get_enums () { return enums; } - + /** * Returns a copy of the list of error domains. * @@ -318,7 +318,7 @@ public class Vala.Namespace : Symbol { public List<ErrorDomain> get_error_domains () { return error_domains; } - + /** * Returns a copy of the list of fields. * @@ -327,7 +327,7 @@ public class Vala.Namespace : Symbol { public List<Field> get_fields () { return fields; } - + /** * Returns a copy of the list of constants. * @@ -336,7 +336,7 @@ public class Vala.Namespace : Symbol { public List<Constant> get_constants () { return constants; } - + /** * Returns a copy of the list of delegates. * @@ -345,7 +345,7 @@ public class Vala.Namespace : Symbol { public List<Delegate> get_delegates () { return delegates; } - + /** * Returns a copy of the list of methods. * @@ -354,7 +354,7 @@ public class Vala.Namespace : Symbol { public List<Method> get_methods () { return methods; } - + /** * Adds the specified constant to this namespace. * @@ -373,7 +373,7 @@ public class Vala.Namespace : Symbol { constants.add (constant); scope.add (constant.name, constant); } - + /** * Adds the specified field to this namespace. * @@ -407,7 +407,7 @@ public class Vala.Namespace : Symbol { fields.add (f); scope.add (f.name, f); } - + /** * Adds the specified method to this namespace. * diff --git a/vala/valanullliteral.vala b/vala/valanullliteral.vala index b5f95d064..bde409a6e 100644 --- a/vala/valanullliteral.vala +++ b/vala/valanullliteral.vala @@ -35,7 +35,7 @@ public class Vala.NullLiteral : Literal { public NullLiteral (SourceReference? source = null) { source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_null_literal (this); diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index 7a2d6fbf8..08a37dfad 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -64,7 +64,7 @@ public class Vala.ObjectCreationExpression : Expression { this.source_reference = source_reference; this.member_name = member_name; } - + /** * Appends the specified expression to the list of arguments. * @@ -117,7 +117,7 @@ public class Vala.ObjectCreationExpression : Expression { if (member_name != null) { member_name.accept (visitor); } - + foreach (Expression arg in argument_list) { arg.accept (visitor); } @@ -441,7 +441,7 @@ public class Vala.ObjectCreationExpression : Expression { if (member_name != null) { member_name.check (context); } - + foreach (Expression arg in argument_list) { arg.check (context); } diff --git a/vala/valaobjecttype.vala b/vala/valaobjecttype.vala index eccdbbddf..4683f2081 100644 --- a/vala/valaobjecttype.vala +++ b/vala/valaobjecttype.vala @@ -43,11 +43,11 @@ public class Vala.ObjectType : ReferenceType { result.nullable = nullable; result.is_dynamic = is_dynamic; result.floating_reference = floating_reference; - + foreach (DataType arg in get_type_arguments ()) { result.add_type_argument (arg.copy ()); } - + return result; } @@ -60,7 +60,7 @@ public class Vala.ObjectType : ReferenceType { if (value_owned != target_type.value_owned) { return false; } - + if (nullable && !target_type.nullable) { return false; } diff --git a/vala/valaobjecttypesymbol.vala b/vala/valaobjecttypesymbol.vala index aca53ed00..eab81c425 100644 --- a/vala/valaobjecttypesymbol.vala +++ b/vala/valaobjecttypesymbol.vala @@ -25,7 +25,7 @@ /** * Represents a runtime data type for objects and interfaces. This data type may - * be defined in Vala source code or imported from an external library with a + * be defined in Vala source code or imported from an external library with a * Vala API file. */ public abstract class Vala.ObjectTypeSymbol : TypeSymbol { diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala index 39820718c..bfc340bc5 100644 --- a/vala/valaparameter.vala +++ b/vala/valaparameter.vala @@ -35,13 +35,13 @@ public class Vala.Parameter : Variable { * parameters. */ public bool ellipsis { get; set; } - + /** * Specifies whether the methods accepts an indefinite number of * parameters. */ public bool params_array { get; set; } - + public bool captured { get; set; } public bool format_arg { @@ -68,7 +68,7 @@ public class Vala.Parameter : Variable { access = SymbolAccessibility.PUBLIC; } - + /** * Creates a new ellipsis parameter representing an indefinite number of * parameters. @@ -87,7 +87,7 @@ public class Vala.Parameter : Variable { public override void accept_children (CodeVisitor visitor) { if (!ellipsis) { variable_type.accept (visitor); - + if (initializer != null) { initializer.accept (visitor); } @@ -151,7 +151,7 @@ public class Vala.Parameter : Variable { if (!ellipsis) { variable_type.check (context); - + if (params_array && !(variable_type is ArrayType)) { error = true; Report.error (source_reference, "parameter array expected"); diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 1b1a06f66..127a118a7 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -332,7 +332,7 @@ public class Vala.Parser : CodeVisitor { index = -1; size = 0; - + next (); @@ -348,7 +348,7 @@ public class Vala.Parser : CodeVisitor { } catch (ParseError e) { report_parse_error (e); } - + scanner = null; if (!has_global_context) { context = null; @@ -406,7 +406,7 @@ public class Vala.Parser : CodeVisitor { } accept (TokenType.INTERR); } - + while (accept (TokenType.OPEN_BRACKET)) { do { // required for decision between expression and declaration statement @@ -423,12 +423,12 @@ public class Vala.Parser : CodeVisitor { bool is_inner_array_type () { var begin = get_location (); - + var result = accept (TokenType.OPEN_PARENS) && accept (TokenType.UNOWNED) && current() != TokenType.CLOSE_PARENS; rollback (begin); return result; } - + DataType parse_type (bool owned_by_default, bool can_weak_ref, bool require_unowned = false) throws ParseError { var begin = get_location (); @@ -468,7 +468,7 @@ public class Vala.Parser : CodeVisitor { if (accept (TokenType.OPEN_PARENS)) { type = parse_type (false, false, true); expect (TokenType.CLOSE_PARENS); - + inner_type_owned = false; expect (TokenType.OPEN_BRACKET); @@ -479,7 +479,7 @@ public class Vala.Parser : CodeVisitor { } else { var sym = parse_symbol_name (); List<DataType> type_arg_list = parse_type_argument_list (false); - + type = new UnresolvedType.from_symbol (sym, get_src (begin)); if (type_arg_list != null) { foreach (DataType type_arg in type_arg_list) { @@ -487,7 +487,7 @@ public class Vala.Parser : CodeVisitor { } } } - + while (accept (TokenType.STAR)) { type = new PointerType (type, get_src (begin)); } @@ -496,7 +496,7 @@ public class Vala.Parser : CodeVisitor { type.nullable = accept (TokenType.INTERR); } } - + // array brackets in types are read from right to left, // this is more logical, especially when nullable arrays // or pointers are involved @@ -914,7 +914,7 @@ public class Vala.Parser : CodeVisitor { expect (TokenType.OPEN_PARENS); expect (TokenType.UNOWNED); } - + var member = parse_member_name (); DataType element_type = UnresolvedType.new_from_expression (member); bool is_pointer_type = false; @@ -927,14 +927,14 @@ public class Vala.Parser : CodeVisitor { element_type.nullable = true; } } - + if (inner_array_type) { expect (TokenType.CLOSE_PARENS); element_type.value_owned = false; } else { element_type.value_owned = true; } - + expect (TokenType.OPEN_BRACKET); bool size_specified = false; @@ -1624,7 +1624,7 @@ public class Vala.Parser : CodeVisitor { if (current () == TokenType.OPEN_PARENS) { return !is_inner_array_type (); } - + var begin = get_location (); // decide between declaration and expression statement @@ -2231,17 +2231,17 @@ public class Vala.Parser : CodeVisitor { void parse_declaration (Symbol parent, bool root = false) throws ParseError { comment = scanner.pop_comment (); var attrs = parse_attributes (); - + var begin = get_location (); - + TokenType last_keyword = current (); - + while (is_declaration_keyword (current ())) { last_keyword = current (); next (); } - - switch (current ()) { + + switch (current ()) { case TokenType.CONSTRUCT: rollback (begin); parse_constructor_declaration (parent, attrs); diff --git a/vala/valapointerindirection.vala b/vala/valapointerindirection.vala index ec8b6b4f7..97f6473a8 100644 --- a/vala/valapointerindirection.vala +++ b/vala/valapointerindirection.vala @@ -37,7 +37,7 @@ public class Vala.PointerIndirection : Expression { _inner.parent_node = this; } } - + private Expression _inner; /** @@ -50,7 +50,7 @@ public class Vala.PointerIndirection : Expression { this.source_reference = source_reference; this.inner = inner; } - + public override void accept (CodeVisitor visitor) { inner.accept (visitor); diff --git a/vala/valapostfixexpression.vala b/vala/valapostfixexpression.vala index 05274c1e9..eed39a39a 100644 --- a/vala/valapostfixexpression.vala +++ b/vala/valapostfixexpression.vala @@ -36,7 +36,7 @@ public class Vala.PostfixExpression : Expression { _inner.parent_node = this; } } - + /** * Specifies whether value should be incremented or decremented. */ @@ -57,7 +57,7 @@ public class Vala.PostfixExpression : Expression { increment = inc; source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_postfix_expression (this); diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala index e0a8e4390..2a83295fb 100644 --- a/vala/valaproperty.vala +++ b/vala/valaproperty.vala @@ -39,7 +39,7 @@ public class Vala.Property : Symbol, Lockable { } } } - + /** * The get accessor of this property if available. */ @@ -52,7 +52,7 @@ public class Vala.Property : Symbol, Lockable { } } } - + /** * The set/construct accessor of this property if available. */ @@ -65,7 +65,7 @@ public class Vala.Property : Symbol, Lockable { } } } - + /** * Represents the generated `this` parameter in this property. */ @@ -76,20 +76,20 @@ public class Vala.Property : Symbol, Lockable { * disabled. */ public bool interface_only { get; set; } - + /** * Specifies whether this property is abstract. Abstract properties have * no accessor bodies, may only be specified within abstract classes and * interfaces, and must be overriden by derived non-abstract classes. */ public bool is_abstract { get; set; } - + /** * Specifies whether this property is virtual. Virtual properties may be * overridden by derived classes. */ public bool is_virtual { get; set; } - + /** * Specifies whether this property overrides a virtual or abstract * property of a base type. @@ -160,7 +160,7 @@ public class Vala.Property : Symbol, Lockable { return _base_property; } } - + /** * Specifies the abstract interface property this property implements. */ @@ -222,7 +222,7 @@ public class Vala.Property : Symbol, Lockable { public override void accept_children (CodeVisitor visitor) { property_type.accept (visitor); - + if (get_accessor != null) { get_accessor.accept (visitor); } @@ -238,11 +238,11 @@ public class Vala.Property : Symbol, Lockable { public bool get_lock_used () { return lock_used; } - + public void set_lock_used (bool used) { lock_used = used; } - + /** * Checks whether the accessors of this property are compatible * with the specified base property. diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala index 81981b84a..73d8c8239 100644 --- a/vala/valapropertyaccessor.vala +++ b/vala/valapropertyaccessor.vala @@ -50,12 +50,12 @@ public class Vala.PropertyAccessor : Subroutine { * Specifies whether this accessor may be used to get the property. */ public bool readable { get; private set; } - + /** * Specifies whether this accessor may be used to set the property. */ public bool writable { get; private set; } - + /** * Specifies whether this accessor may be used to construct the * property. @@ -77,7 +77,7 @@ public class Vala.PropertyAccessor : Subroutine { public Parameter value_parameter { get; private set; } private DataType _value_type; - + /** * Creates a new property accessor. * diff --git a/vala/valarealliteral.vala b/vala/valarealliteral.vala index 550c2b45c..3ef4d6e66 100644 --- a/vala/valarealliteral.vala +++ b/vala/valarealliteral.vala @@ -42,13 +42,13 @@ public class Vala.RealLiteral : Literal { value = r; source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_real_literal (this); visitor.visit_expression (this); } - + /** * Returns the type name of the value this literal represents. * @@ -58,7 +58,7 @@ public class Vala.RealLiteral : Literal { if (value.has_suffix ("f") || value.has_suffix ("F")) { return "float"; } - + return "double"; } diff --git a/vala/valareferencetransferexpression.vala b/vala/valareferencetransferexpression.vala index ceb51a2a2..9362bbd1c 100644 --- a/vala/valareferencetransferexpression.vala +++ b/vala/valareferencetransferexpression.vala @@ -37,7 +37,7 @@ public class Vala.ReferenceTransferExpression : Expression { _inner.parent_node = this; } } - + private Expression _inner; /** @@ -50,13 +50,13 @@ public class Vala.ReferenceTransferExpression : Expression { this.inner = inner; this.source_reference = source_reference; } - + public override void accept (CodeVisitor visitor) { visitor.visit_reference_transfer_expression (this); visitor.visit_expression (this); } - + public override void accept_children (CodeVisitor visitor) { inner.accept (visitor); } diff --git a/vala/valareport.vala b/vala/valareport.vala index 3015ea3e4..766788706 100644 --- a/vala/valareport.vala +++ b/vala/valareport.vala @@ -394,7 +394,7 @@ public class Vala.Report { private delegate int AttyFunc (int fd); private bool is_atty (int fd) { - Module module = Module.open (null, ModuleFlags.BIND_LAZY); + Module module = Module.open (null, ModuleFlags.BIND_LAZY); if (module == null) { return false; } diff --git a/vala/valareturnstatement.vala b/vala/valareturnstatement.vala index e407aec4a..2cb1e6dd5 100644 --- a/vala/valareturnstatement.vala +++ b/vala/valareturnstatement.vala @@ -59,7 +59,7 @@ public class Vala.ReturnStatement : CodeNode, Statement { public override void accept_children (CodeVisitor visitor) { if (return_expression != null) { return_expression.accept (visitor); - + visitor.visit_end_full_expression (return_expression); } } diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index ddf6f2859..73b0b61ef 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -924,10 +924,10 @@ public class Vala.SemanticAnalyzer : CodeVisitor { } else { temp_access.target_type = target_type != null ? target_type.copy () : null; } - + return temp_access; } - + public void visit_member_initializer (MemberInitializer init, DataType type) { init.symbol_reference = symbol_lookup_inherited (type.data_type, init.name); if (!(init.symbol_reference is Field || init.symbol_reference is Property)) { diff --git a/vala/valasignal.vala b/vala/valasignal.vala index d0a6ac0c3..1597a1fa9 100644 --- a/vala/valasignal.vala +++ b/vala/valasignal.vala @@ -83,7 +83,7 @@ public class Vala.Signal : Symbol, Lockable, Callable { base (name, source_reference, comment); this.return_type = return_type; } - + /** * Appends parameter to signal handler. * @@ -149,14 +149,14 @@ public class Vala.Signal : Symbol, Lockable, Callable { return generated_delegate; } - + public override void accept (CodeVisitor visitor) { visitor.visit_signal (this); } public override void accept_children (CodeVisitor visitor) { return_type.accept (visitor); - + foreach (Parameter param in parameters) { param.accept (visitor); } @@ -173,7 +173,7 @@ public class Vala.Signal : Symbol, Lockable, Callable { public bool get_lock_used () { return lock_used; } - + public void set_lock_used (bool used) { lock_used = used; } @@ -192,7 +192,7 @@ public class Vala.Signal : Symbol, Lockable, Callable { checked = true; return_type.check (context); - + foreach (Parameter param in parameters) { if (param.ellipsis) { Report.error (param.source_reference, "Signals with variable argument lists are not supported"); diff --git a/vala/valasizeofexpression.vala b/vala/valasizeofexpression.vala index 42c1ee599..e5de62d62 100644 --- a/vala/valasizeofexpression.vala +++ b/vala/valasizeofexpression.vala @@ -50,7 +50,7 @@ public class Vala.SizeofExpression : Expression { type_reference = type; source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_sizeof_expression (this); diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala index 1263bcd7d..b056c0126 100644 --- a/vala/valasourcefile.vala +++ b/vala/valasourcefile.vala @@ -30,7 +30,7 @@ public class Vala.SourceFile { * The name of this source file. */ public string filename { get; set; } - + public string? relative_filename { set { this._relative_filename = value; @@ -359,7 +359,7 @@ public class Vala.SourceFile { return mapped_file.get_contents (); } - + public size_t get_mapped_length () { if (content != null) { return content.length; diff --git a/vala/valasourcereference.vala b/vala/valasourcereference.vala index ffacd5253..24aeeda45 100644 --- a/vala/valasourcereference.vala +++ b/vala/valasourcereference.vala @@ -57,7 +57,7 @@ public class Vala.SourceReference { this.end = end; using_directives = file.current_using_directives; } - + /** * Returns a string representation of this source reference. * diff --git a/vala/valastringliteral.vala b/vala/valastringliteral.vala index 72970c6d7..d1995576c 100644 --- a/vala/valastringliteral.vala +++ b/vala/valastringliteral.vala @@ -49,18 +49,18 @@ public class Vala.StringLiteral : Literal { * Evaluates the literal string value. * * @return the unescaped string - */ + */ public string? eval () { if (value == null) { return null; } - + /* remove quotes */ var noquotes = value.substring (1, (uint) (value.length - 2)); /* unescape string */ return noquotes.compress (); } - + public override void accept (CodeVisitor visitor) { visitor.visit_string_literal (this); diff --git a/vala/valastruct.vala b/vala/valastruct.vala index 21985d7af..972b4bdab 100644 --- a/vala/valastruct.vala +++ b/vala/valastruct.vala @@ -144,7 +144,7 @@ public class Vala.Struct : TypeSymbol { type_parameters.add (p); scope.add (p.name, p); } - + /** * Returns a copy of the type parameter list. * @@ -163,7 +163,7 @@ public class Vala.Struct : TypeSymbol { constants.add (c); scope.add (c.name, c); } - + /** * Adds the specified field as a member to this struct. * @@ -175,7 +175,7 @@ public class Vala.Struct : TypeSymbol { fields.add (f); scope.add (f.name, f); } - + /** * Returns a copy of the list of fields. * @@ -201,7 +201,7 @@ public class Vala.Struct : TypeSymbol { */ public override void add_method (Method m) { return_if_fail (m != null); - + if (m.binding == MemberBinding.INSTANCE || m is CreationMethod) { m.this_parameter = new Parameter ("this", SemanticAnalyzer.get_data_type_for_symbol (this)); m.scope.add (m.this_parameter.name, m.this_parameter); @@ -228,7 +228,7 @@ public class Vala.Struct : TypeSymbol { methods.add (m); scope.add (m.name, m); } - + /** * Returns a copy of the list of methods. * @@ -276,15 +276,15 @@ public class Vala.Struct : TypeSymbol { foreach (TypeParameter p in type_parameters) { p.accept (visitor); } - + foreach (Field f in fields) { f.accept (visitor); } - + foreach (Constant c in constants) { c.accept (visitor); } - + foreach (Method m in methods) { m.accept (visitor); } @@ -325,7 +325,7 @@ public class Vala.Struct : TypeSymbol { } return integer_type; } - + /** * Returns whether this is a floating point type. * @@ -388,14 +388,14 @@ public class Vala.Struct : TypeSymbol { public override int get_type_parameter_index (string name) { int i = 0; - + foreach (TypeParameter p in type_parameters) { if (p.name == name) { return (i); } i++; } - + return -1; } diff --git a/vala/valaswitchlabel.vala b/vala/valaswitchlabel.vala index 99fbb4a69..70eb7e336 100644 --- a/vala/valaswitchlabel.vala +++ b/vala/valaswitchlabel.vala @@ -54,19 +54,19 @@ public class Vala.SwitchLabel : CodeNode { public SwitchLabel.with_default (SourceReference? source = null) { source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_switch_label (this); } - + public override void accept_children (CodeVisitor visitor) { if (expression != null) { expression.accept (visitor); - + visitor.visit_end_full_expression (expression); } } - + public override bool check (CodeContext context) { if (expression != null) { var switch_statement = (SwitchStatement) section.parent_node; diff --git a/vala/valaswitchsection.vala b/vala/valaswitchsection.vala index bf9932f04..156740f80 100644 --- a/vala/valaswitchsection.vala +++ b/vala/valaswitchsection.vala @@ -37,7 +37,7 @@ public class Vala.SwitchSection : Block { public SwitchSection (SourceReference? source_reference) { base (source_reference); } - + /** * Appends the specified label to the list of switch labels. * @@ -51,7 +51,7 @@ public class Vala.SwitchSection : Block { labels.add (label); label.section = this; } - + /** * Returns a copy of the list of switch labels. * @@ -60,17 +60,17 @@ public class Vala.SwitchSection : Block { public List<SwitchLabel> get_labels () { return labels; } - + public bool has_default_label () { foreach (SwitchLabel label in labels) { if (label.expression == null) { return true; } } - + return false; } - + public override void accept (CodeVisitor visitor) { visitor.visit_switch_section (this); } diff --git a/vala/valaswitchstatement.vala b/vala/valaswitchstatement.vala index c583f8db9..66dab0193 100644 --- a/vala/valaswitchstatement.vala +++ b/vala/valaswitchstatement.vala @@ -53,7 +53,7 @@ public class Vala.SwitchStatement : CodeNode, Statement { this.source_reference = source_reference; this.expression = expression; } - + /** * Appends the specified section to the list of switch sections. * @@ -63,7 +63,7 @@ public class Vala.SwitchStatement : CodeNode, Statement { section.parent_node = this; sections.add (section); } - + /** * Returns a copy of the list of switch sections. * @@ -81,7 +81,7 @@ public class Vala.SwitchStatement : CodeNode, Statement { expression.accept (visitor); visitor.visit_end_full_expression (expression); - + foreach (SwitchSection section in sections) { section.accept (visitor); } @@ -92,7 +92,7 @@ public class Vala.SwitchStatement : CodeNode, Statement { expression = new_node; } } - + public override bool check (CodeContext context) { if (checked) { return !error; diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala index 3dcd820cc..ed1ad8318 100644 --- a/vala/valasymbol.vala +++ b/vala/valasymbol.vala @@ -105,7 +105,7 @@ public abstract class Vala.Symbol : CodeNode { public bool hides { get; set; } /** - * Check if this symbol is just internal API (and therefore doesn't need + * Check if this symbol is just internal API (and therefore doesn't need * to be listed in header files for instance) by traversing parent symbols * and checking their accessibility. */ @@ -209,7 +209,7 @@ public abstract class Vala.Symbol : CodeNode { if (parent_symbol == null) { return name; } - + if (name == null) { return parent_symbol.get_full_name (); } @@ -224,7 +224,7 @@ public abstract class Vala.Symbol : CodeNode { return "%s.%s".printf (parent_symbol.get_full_name (), name); } } - + /** * Converts a string from CamelCase to lower_case. * @@ -261,13 +261,13 @@ public abstract class Vala.Symbol : CodeNode { } } } - + result_builder.append_unichar (c.tolower ()); - + first = false; i = i.next_char (); } - + return result_builder.str; } @@ -296,7 +296,7 @@ public abstract class Vala.Symbol : CodeNode { } else { result_builder.append_unichar (c); } - + i = i.next_char (); } diff --git a/vala/valasymbolresolver.vala b/vala/valasymbolresolver.vala index 8b7f75cd3..55fa94f62 100644 --- a/vala/valasymbolresolver.vala +++ b/vala/valasymbolresolver.vala @@ -31,7 +31,7 @@ public class Vala.SymbolResolver : CodeVisitor { CodeContext context; Symbol root_symbol; Scope current_scope; - + /** * Resolve symbol names in the specified code context. * @@ -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; @@ -55,7 +55,7 @@ public class Vala.SymbolResolver : CodeVisitor { current_scope = old_scope; } - + public override void visit_class (Class cl) { current_scope = cl.scope; diff --git a/vala/valatypecheck.vala b/vala/valatypecheck.vala index 4a49f5bac..b02cd9405 100644 --- a/vala/valatypecheck.vala +++ b/vala/valatypecheck.vala @@ -36,7 +36,7 @@ public class Vala.TypeCheck : Expression { _expression.parent_node = this; } } - + /** * The type to be matched against. */ @@ -58,13 +58,13 @@ public class Vala.TypeCheck : Expression { * @param type a data type * @param source reference to source code * @return newly created type check expression - */ + */ public TypeCheck (Expression expr, DataType type, SourceReference source) { expression = expr; type_reference = type; source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_type_check (this); @@ -101,7 +101,7 @@ public class Vala.TypeCheck : Expression { checked = true; expression.check (context); - + type_reference.check (context); if (expression.value_type == null) { diff --git a/vala/valatypeofexpression.vala b/vala/valatypeofexpression.vala index 9b0e02e13..936c7d44a 100644 --- a/vala/valatypeofexpression.vala +++ b/vala/valatypeofexpression.vala @@ -50,7 +50,7 @@ public class Vala.TypeofExpression : Expression { type_reference = type; source_reference = source; } - + public override void accept (CodeVisitor visitor) { visitor.visit_typeof_expression (this); diff --git a/vala/valatypesymbol.vala b/vala/valatypesymbol.vala index 8ba3aef57..ce1d4ea30 100644 --- a/vala/valatypesymbol.vala +++ b/vala/valatypesymbol.vala @@ -52,7 +52,7 @@ public abstract class Vala.TypeSymbol : Symbol { public virtual bool is_subtype_of (TypeSymbol t) { return (this == t); } - + /** * Return the index of the specified type parameter name. */ diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala index 95b0d4fc4..87f4032ef 100644 --- a/vala/valaunaryexpression.vala +++ b/vala/valaunaryexpression.vala @@ -44,7 +44,7 @@ public class Vala.UnaryExpression : Expression { _inner.parent_node = this; } } - + private Expression _inner; /** diff --git a/vala/valaunresolvedtype.vala b/vala/valaunresolvedtype.vala index 527fa0a7d..84244809c 100644 --- a/vala/valaunresolvedtype.vala +++ b/vala/valaunresolvedtype.vala @@ -78,11 +78,11 @@ public class Vala.UnresolvedType : DataType { result.nullable = nullable; result.is_dynamic = is_dynamic; result.unresolved_symbol = unresolved_symbol.copy (); - + foreach (DataType arg in get_type_arguments ()) { result.add_type_argument (arg.copy ()); } - + return result; } diff --git a/vala/valausedattr.vala b/vala/valausedattr.vala index 4a76e2df4..4947b33a9 100644 --- a/vala/valausedattr.vala +++ b/vala/valausedattr.vala @@ -63,7 +63,7 @@ public class Vala.UsedAttr : CodeVisitor { "Version", "since", "replacement", "deprecated", "deprecated_since", "experimental", "experimental_until", "", "Signal", "detailed", "run", "no_recurse", "action", "no_hooks", "", "Description", "nick", "blurb", "", - + "IntegerType", "rank", "min", "max", "signed", "width", "", "FloatingType", "rank", "decimal", "width", "", "BooleanType", "", @@ -86,7 +86,7 @@ public class Vala.UsedAttr : CodeVisitor { "GIR", "fullname", "name", "" }; - + public UsedAttr () { // mark default valac attrs var curattr = ""; @@ -103,7 +103,7 @@ public class Vala.UsedAttr : CodeVisitor { } } } - + /** * Mark the attribute or attribute argument as used by the compiler */ @@ -118,7 +118,7 @@ public class Vala.UsedAttr : CodeVisitor { set.add (argument); } } - + /** * Traverse the code tree and warn about unused attributes. * @@ -145,12 +145,12 @@ public class Vala.UsedAttr : CodeVisitor { } } } - + public override void visit_namespace (Namespace ns) { check_unused_attr (ns); ns.accept_children (this); } - + public override void visit_class (Class cl) { check_unused_attr (cl); cl.accept_children (this); diff --git a/vala/valausingdirective.vala b/vala/valausingdirective.vala index 9fb0766af..15bb2d034 100644 --- a/vala/valausingdirective.vala +++ b/vala/valausingdirective.vala @@ -41,7 +41,7 @@ public class Vala.UsingDirective : CodeNode { this.namespace_symbol = namespace_symbol; this.source_reference = source_reference; } - + public override void accept (CodeVisitor visitor) { visitor.visit_using_directive (this); } diff --git a/vala/valavariable.vala b/vala/valavariable.vala index e625e660b..80a444c0b 100644 --- a/vala/valavariable.vala +++ b/vala/valavariable.vala @@ -35,7 +35,7 @@ public class Vala.Variable : Symbol { } } } - + /** * The variable type. */ diff --git a/vala/valawhilestatement.vala b/vala/valawhilestatement.vala index 6a1bcde13..9c4e65e6c 100644 --- a/vala/valawhilestatement.vala +++ b/vala/valawhilestatement.vala @@ -38,7 +38,7 @@ public class Vala.WhileStatement : CodeNode, Statement { _condition.parent_node = this; } } - + /** * Specifies the loop body. */ @@ -68,14 +68,14 @@ public class Vala.WhileStatement : CodeNode, Statement { this.source_reference = source_reference; this.condition = condition; } - + public override void accept (CodeVisitor visitor) { visitor.visit_while_statement (this); } public override void accept_children (CodeVisitor visitor) { condition.accept (visitor); - + visitor.visit_end_full_expression (condition); body.accept (visitor); |