diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2018-03-27 12:46:26 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2018-03-27 13:12:02 +0200 |
commit | 55d883a5b593be366aff440ead4571ee76d86d02 (patch) | |
tree | be85465984a784b0e553a1c15f6e9c91b257be3c | |
parent | 7bd54c7a88555831febf186295cc44a7301aa83f (diff) | |
download | vala-55d883a5b593be366aff440ead4571ee76d86d02.tar.gz |
Drop trailing spaces/tabs
It was about time to do this.
196 files changed, 997 insertions, 997 deletions
diff --git a/ccode/valaccodeassignment.vala b/ccode/valaccodeassignment.vala index 57f525d1b..247496df0 100644 --- a/ccode/valaccodeassignment.vala +++ b/ccode/valaccodeassignment.vala @@ -30,7 +30,7 @@ public class Vala.CCodeAssignment : CCodeExpression { * Left hand side of the assignment. */ public CCodeExpression left { get; set; } - + /** * Assignment operator. */ @@ -40,13 +40,13 @@ public class Vala.CCodeAssignment : CCodeExpression { * Right hand side of the assignment. */ public CCodeExpression right { get; set; } - + public CCodeAssignment (CCodeExpression l, CCodeExpression r, CCodeAssignmentOperator op = CCodeAssignmentOperator.SIMPLE) { left = l; operator = op; right = r; } - + public override void write (CCodeWriter writer) { left.write (writer); @@ -74,7 +74,7 @@ public class Vala.CCodeAssignment : CCodeExpression { writer.write_string (")"); } } - + public enum Vala.CCodeAssignmentOperator { SIMPLE, BITWISE_OR, diff --git a/ccode/valaccodebinaryexpression.vala b/ccode/valaccodebinaryexpression.vala index 651e2cac3..f001c0825 100644 --- a/ccode/valaccodebinaryexpression.vala +++ b/ccode/valaccodebinaryexpression.vala @@ -40,13 +40,13 @@ public class Vala.CCodeBinaryExpression : CCodeExpression { * The right operand. */ public CCodeExpression right { get; set; } - + public CCodeBinaryExpression (CCodeBinaryOperator op, CCodeExpression l, CCodeExpression r) { operator = op; left = l; right = r; } - + public override void write (CCodeWriter writer) { left.write_inner (writer); diff --git a/ccode/valaccodeblock.vala b/ccode/valaccodeblock.vala index 5c8f2c74d..6c9bbe4af 100644 --- a/ccode/valaccodeblock.vala +++ b/ccode/valaccodeblock.vala @@ -33,14 +33,14 @@ public class Vala.CCodeBlock : CCodeStatement { public bool suppress_newline { get; set; } private List<CCodeNode> statements = new ArrayList<CCodeNode> (); - + /** * Prepend the specified statement to the list of statements. */ public void prepend_statement (CCodeNode statement) { statements.insert (0, statement); } - + /** * Append the specified statement to the list of statements. */ @@ -48,7 +48,7 @@ public class Vala.CCodeBlock : CCodeStatement { /* allow generic nodes to include comments */ statements.add (statement); } - + public override void write (CCodeWriter writer) { // the last reachable statement CCodeNode last_statement = null; diff --git a/ccode/valaccodecasestatement.vala b/ccode/valaccodecasestatement.vala index 82b85f45a..021d28078 100644 --- a/ccode/valaccodecasestatement.vala +++ b/ccode/valaccodecasestatement.vala @@ -30,11 +30,11 @@ public class Vala.CCodeCaseStatement : CCodeStatement { * The case expression. */ public CCodeExpression expression { get; set; } - + public CCodeCaseStatement (CCodeExpression expression) { this.expression = expression; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("case "); diff --git a/ccode/valaccodecastexpression.vala b/ccode/valaccodecastexpression.vala index e53e6c2b6..a06b1fa39 100644 --- a/ccode/valaccodecastexpression.vala +++ b/ccode/valaccodecastexpression.vala @@ -30,17 +30,17 @@ public class Vala.CCodeCastExpression : CCodeExpression { * The expression to be cast. */ public CCodeExpression inner { get; set; } - + /** * The target type. */ public string type_name { get; set; } - + public CCodeCastExpression (CCodeExpression expr, string type) { inner = expr; type_name = type; } - + public override void write (CCodeWriter writer) { writer.write_string ("("); writer.write_string (type_name); diff --git a/ccode/valaccodecommaexpression.vala b/ccode/valaccodecommaexpression.vala index 6010428e0..f72a98713 100644 --- a/ccode/valaccodecommaexpression.vala +++ b/ccode/valaccodecommaexpression.vala @@ -27,7 +27,7 @@ using GLib; */ public class Vala.CCodeCommaExpression : CCodeExpression { private List<CCodeExpression> inner = new ArrayList<CCodeExpression> (); - + /** * Appends the specified expression to the expression list. * @@ -47,7 +47,7 @@ public class Vala.CCodeCommaExpression : CCodeExpression { public override void write (CCodeWriter writer) { bool first = true; - + writer.write_string ("("); foreach (CCodeExpression expr in inner) { if (!first) { diff --git a/ccode/valaccodecomment.vala b/ccode/valaccodecomment.vala index 3aacaa488..2902ebfd7 100644 --- a/ccode/valaccodecomment.vala +++ b/ccode/valaccodecomment.vala @@ -30,11 +30,11 @@ public class Vala.CCodeComment : CCodeNode { * The text content of the comment. */ public string text { get; set; } - + public CCodeComment (string _text) { text = _text; } - + public override void write (CCodeWriter writer) { writer.write_comment (text); } diff --git a/ccode/valaccodeconditionalexpression.vala b/ccode/valaccodeconditionalexpression.vala index b894928d7..24e5f9e74 100644 --- a/ccode/valaccodeconditionalexpression.vala +++ b/ccode/valaccodeconditionalexpression.vala @@ -30,23 +30,23 @@ public class Vala.CCodeConditionalExpression : CCodeExpression { * The condition. */ public CCodeExpression condition { get; set; } - + /** * The expression to be evaluated if the condition holds. */ public CCodeExpression true_expression { get; set; } - + /** * The expression to be evaluated if the condition doesn't hold. */ public CCodeExpression false_expression { get; set; } - + public CCodeConditionalExpression (CCodeExpression cond, CCodeExpression true_expr, CCodeExpression false_expr) { condition = cond; true_expression = true_expr; false_expression = false_expr; } - + public override void write (CCodeWriter writer) { condition.write_inner (writer); writer.write_string (" ? "); diff --git a/ccode/valaccodedeclaration.vala b/ccode/valaccodedeclaration.vala index 4cbd86204..eb69c6a61 100644 --- a/ccode/valaccodedeclaration.vala +++ b/ccode/valaccodedeclaration.vala @@ -32,11 +32,11 @@ public class Vala.CCodeDeclaration : CCodeStatement { public string type_name { get; set; } private List<CCodeDeclarator> declarators = new ArrayList<CCodeDeclarator> (); - + public CCodeDeclaration (string type_name) { this.type_name = type_name; } - + /** * Adds the specified declarator to this declaration. * @@ -45,7 +45,7 @@ public class Vala.CCodeDeclaration : CCodeStatement { public void add_declarator (CCodeDeclarator decl) { declarators.add (decl); } - + public override void write (CCodeWriter writer) { if ((modifiers & (CCodeModifiers.STATIC | CCodeModifiers.INTERNAL | CCodeModifiers.EXTERN)) == 0) { foreach (CCodeDeclarator decl in declarators) { @@ -110,7 +110,7 @@ public class Vala.CCodeDeclaration : CCodeStatement { } writer.write_string (type_name); writer.write_string (" "); - + bool first = true; foreach (CCodeDeclarator decl in declarators) { if (!first) { diff --git a/ccode/valaccodedostatement.vala b/ccode/valaccodedostatement.vala index 7101f8bdb..18c803e94 100644 --- a/ccode/valaccodedostatement.vala +++ b/ccode/valaccodedostatement.vala @@ -35,12 +35,12 @@ public class Vala.CCodeDoStatement : CCodeStatement { * The loop condition. */ public CCodeExpression condition { get; set; } - + public CCodeDoStatement (CCodeStatement stmt, CCodeExpression cond) { body = stmt; condition = cond; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("do"); diff --git a/ccode/valaccodeelementaccess.vala b/ccode/valaccodeelementaccess.vala index dc62485ba..3586aec1f 100644 --- a/ccode/valaccodeelementaccess.vala +++ b/ccode/valaccodeelementaccess.vala @@ -32,18 +32,18 @@ public class Vala.CCodeElementAccess : CCodeExpression { * Expression representing the container on which we want to access. */ public CCodeExpression container { get; set; } - + /** * Expression representing the index we want to access inside the * container. */ public CCodeExpression index { get; set; } - + public CCodeElementAccess (CCodeExpression cont, CCodeExpression i) { container = cont; index = i; } - + public override void write (CCodeWriter writer) { container.write_inner (writer); writer.write_string ("["); diff --git a/ccode/valaccodeenum.vala b/ccode/valaccodeenum.vala index f2a378879..c94ad02ae 100644 --- a/ccode/valaccodeenum.vala +++ b/ccode/valaccodeenum.vala @@ -32,11 +32,11 @@ public class Vala.CCodeEnum : CCodeNode { public string name { get; set; } private List<CCodeEnumValue> values = new ArrayList<CCodeEnumValue> (); - + public CCodeEnum (string? name = null) { this.name = name; } - + /** * Adds the specified value to this enum. * @@ -45,7 +45,7 @@ public class Vala.CCodeEnum : CCodeNode { public void add_value (CCodeEnumValue value) { values.add (value); } - + public override void write (CCodeWriter writer) { if (name != null) { writer.write_string ("typedef "); diff --git a/ccode/valaccodeenumvalue.vala b/ccode/valaccodeenumvalue.vala index 2fa408587..f11326f56 100644 --- a/ccode/valaccodeenumvalue.vala +++ b/ccode/valaccodeenumvalue.vala @@ -35,7 +35,7 @@ public class Vala.CCodeEnumValue : CCodeNode { * The numerical representation of this enum value. */ public CCodeExpression? value { get; set; } - + public CCodeEnumValue (string name, CCodeExpression? value = null) { this.name = name; this.value = value; diff --git a/ccode/valaccodeexpressionstatement.vala b/ccode/valaccodeexpressionstatement.vala index 57b2b2da4..ae721939a 100644 --- a/ccode/valaccodeexpressionstatement.vala +++ b/ccode/valaccodeexpressionstatement.vala @@ -30,7 +30,7 @@ public class Vala.CCodeExpressionStatement : CCodeStatement { * The expression to evaluate. */ public CCodeExpression expression { get; set; } - + public CCodeExpressionStatement (CCodeExpression expr) { expression = expr; } diff --git a/ccode/valaccodeforstatement.vala b/ccode/valaccodeforstatement.vala index c4d14be95..f821e0d46 100644 --- a/ccode/valaccodeforstatement.vala +++ b/ccode/valaccodeforstatement.vala @@ -30,15 +30,15 @@ public class Vala.CCodeForStatement : CCodeStatement { * The loop condition. */ public CCodeExpression? condition { get; set; } - + /** * The loop body. */ public CCodeStatement body { get; set; } - + private List<CCodeExpression> initializer = new ArrayList<CCodeExpression> (); private List<CCodeExpression> iterator = new ArrayList<CCodeExpression> (); - + public CCodeForStatement (CCodeExpression? condition, CCodeStatement? body = null) { this.condition = condition; this.body = body; @@ -61,13 +61,13 @@ public class Vala.CCodeForStatement : CCodeStatement { public void add_iterator (CCodeExpression expr) { iterator.add (expr); } - + public override void write (CCodeWriter writer) { bool first; - + writer.write_indent (line); writer.write_string ("for ("); - + first = true; foreach (CCodeExpression init_expr in initializer) { if (!first) { @@ -85,7 +85,7 @@ public class Vala.CCodeForStatement : CCodeStatement { condition.write (writer); } writer.write_string ("; "); - + first = true; foreach (CCodeExpression it_expr in iterator) { if (!first) { diff --git a/ccode/valaccodefragment.vala b/ccode/valaccodefragment.vala index 0e229fffa..51538da6b 100644 --- a/ccode/valaccodefragment.vala +++ b/ccode/valaccodefragment.vala @@ -27,7 +27,7 @@ using GLib; */ public class Vala.CCodeFragment : CCodeNode { private List<CCodeNode> children = new ArrayList<CCodeNode> (); - + /** * Appends the specified code node to this code fragment. * @@ -36,7 +36,7 @@ public class Vala.CCodeFragment : CCodeNode { public void append (CCodeNode node) { children.add (node); } - + /** * Returns a copy of the list of children. * diff --git a/ccode/valaccodefunction.vala b/ccode/valaccodefunction.vala index 2458d9c3b..688c6d1eb 100644 --- a/ccode/valaccodefunction.vala +++ b/ccode/valaccodefunction.vala @@ -30,7 +30,7 @@ public class Vala.CCodeFunction : CCodeNode { * The name of this function. */ public string name { get; set; } - + /** * The function return type. */ @@ -63,7 +63,7 @@ public class Vala.CCodeFunction : CCodeNode { this.block = new CCodeBlock (); current_block = block; } - + /** * Appends the specified parameter to the list of function parameters. * @@ -100,12 +100,12 @@ public class Vala.CCodeFunction : CCodeNode { foreach (CCodeParameter param in parameters) { func.parameters.add (param); } - + func.is_declaration = is_declaration; func.block = block; return func; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); if (CCodeModifiers.INTERNAL in modifiers) { @@ -126,7 +126,7 @@ public class Vala.CCodeFunction : CCodeNode { writer.write_string (name); writer.write_string (" ("); int param_pos_begin = (is_declaration ? return_type.char_count () + 1 : 0 ) + name.char_count () + 2; - + bool has_args = (CCodeModifiers.PRINTF in modifiers || CCodeModifiers.SCANF in modifiers); int i = 0; int format_arg_index = -1; @@ -151,7 +151,7 @@ public class Vala.CCodeFunction : CCodeNode { if (i == 0) { writer.write_string ("void"); } - + writer.write_string (")"); if (is_declaration) { diff --git a/ccode/valaccodefunctioncall.vala b/ccode/valaccodefunctioncall.vala index e9e7d14c3..e4a8ec16d 100644 --- a/ccode/valaccodefunctioncall.vala +++ b/ccode/valaccodefunctioncall.vala @@ -30,13 +30,13 @@ public class Vala.CCodeFunctionCall : CCodeExpression { * The function to be called. */ public CCodeExpression? call { get; set; } - + private List<CCodeExpression> arguments = new ArrayList<CCodeExpression> (); - + public CCodeFunctionCall (CCodeExpression? call = null) { this.call = call; } - + /** * Appends the specified expression to the list of arguments. * @@ -70,7 +70,7 @@ public class Vala.CCodeFunctionCall : CCodeExpression { } else { first = false; } - + if (expr != null) { expr.write (writer); } diff --git a/ccode/valaccodefunctiondeclarator.vala b/ccode/valaccodefunctiondeclarator.vala index 30f0c63b1..529473d14 100644 --- a/ccode/valaccodefunctiondeclarator.vala +++ b/ccode/valaccodefunctiondeclarator.vala @@ -30,13 +30,13 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator { * The declarator name. */ public string name { get; set; } - + private List<CCodeParameter> parameters = new ArrayList<CCodeParameter> (); - + public CCodeFunctionDeclarator (string name) { this.name = name; } - + /** * Appends the specified parameter to the list of function parameters. * @@ -45,16 +45,16 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator { public void add_parameter (CCodeParameter param) { parameters.add (param); } - + public override void write (CCodeWriter writer) { write_declaration (writer); } - + public override void write_declaration (CCodeWriter writer) { writer.write_string ("(*"); writer.write_string (name); writer.write_string (") ("); - + bool has_args = (CCodeModifiers.PRINTF in modifiers || CCodeModifiers.SCANF in modifiers); int i = 0; int format_arg_index = -1; @@ -74,7 +74,7 @@ public class Vala.CCodeFunctionDeclarator : CCodeDeclarator { } i++; } - + writer.write_string (")"); if (CCodeModifiers.DEPRECATED in modifiers) { diff --git a/ccode/valaccodegotostatement.vala b/ccode/valaccodegotostatement.vala index 14e2c7d88..b1e0d2980 100644 --- a/ccode/valaccodegotostatement.vala +++ b/ccode/valaccodegotostatement.vala @@ -34,7 +34,7 @@ public class Vala.CCodeGotoStatement : CCodeStatement { public CCodeGotoStatement (string name) { this.name = name; } - + public override void write (CCodeWriter writer) { writer.write_indent (); writer.write_string ("goto "); diff --git a/ccode/valaccodeidentifier.vala b/ccode/valaccodeidentifier.vala index 0954e0a50..f0b1f0106 100644 --- a/ccode/valaccodeidentifier.vala +++ b/ccode/valaccodeidentifier.vala @@ -30,11 +30,11 @@ public class Vala.CCodeIdentifier : CCodeExpression { * The name of this identifier. */ public string name { get; set; } - + public CCodeIdentifier (string _name) { name = _name; } - + public override void write (CCodeWriter writer) { writer.write_string (name); } diff --git a/ccode/valaccodeifstatement.vala b/ccode/valaccodeifstatement.vala index 31a7da996..c4522302e 100644 --- a/ccode/valaccodeifstatement.vala +++ b/ccode/valaccodeifstatement.vala @@ -30,29 +30,29 @@ public class Vala.CCodeIfStatement : CCodeStatement { * The boolean condition to evaluate. */ public CCodeExpression condition { get; set; } - + /** * The statement to be evaluated if the condition holds. */ public CCodeStatement true_statement { get; set; } - + /** * The optional statement to be evaluated if the condition doesn't hold. */ public CCodeStatement? false_statement { get; set; } - + public CCodeIfStatement (CCodeExpression cond, CCodeStatement true_stmt, CCodeStatement? false_stmt = null) { condition = cond; true_statement = true_stmt; false_statement = false_stmt; } - + /** * Specifies whether this if statement is part of an else if statement. * This only affects the output formatting. */ public bool else_if { get; set; } - + public override void write (CCodeWriter writer) { if (!else_if) { writer.write_indent (line); @@ -64,13 +64,13 @@ public class Vala.CCodeIfStatement : CCodeStatement { condition.write (writer); } writer.write_string (")"); - + /* else shouldn't be on a separate line */ if (false_statement != null && true_statement is CCodeBlock) { var cblock = (CCodeBlock) true_statement; cblock.suppress_newline = true; } - + true_statement.write (writer); if (false_statement != null) { if (writer.bol) { @@ -79,13 +79,13 @@ public class Vala.CCodeIfStatement : CCodeStatement { } else { writer.write_string (" else"); } - + /* else if should be on one line */ if (false_statement is CCodeIfStatement) { var cif = (CCodeIfStatement) false_statement; cif.else_if = true; } - + false_statement.write (writer); } } diff --git a/ccode/valaccodeincludedirective.vala b/ccode/valaccodeincludedirective.vala index 549e3f751..184185d95 100644 --- a/ccode/valaccodeincludedirective.vala +++ b/ccode/valaccodeincludedirective.vala @@ -30,18 +30,18 @@ public class Vala.CCodeIncludeDirective : CCodeNode { * The file to be included. */ public string filename { get; set; } - + /** * Specifies whether the specified file should be searched in the local * directory. */ public bool local { get; set; } - + public CCodeIncludeDirective (string _filename, bool _local = false) { filename = _filename; local = _local; } - + public override void write (CCodeWriter writer) { writer.write_indent (); writer.write_string ("#include "); diff --git a/ccode/valaccodeinitializerlist.vala b/ccode/valaccodeinitializerlist.vala index 26cb56e1d..2be3a846a 100644 --- a/ccode/valaccodeinitializerlist.vala +++ b/ccode/valaccodeinitializerlist.vala @@ -27,7 +27,7 @@ using GLib; */ public class Vala.CCodeInitializerList : CCodeExpression { private List<CCodeExpression> initializers = new ArrayList<CCodeExpression> (); - + /** * Appends the specified expression to this initializer list. * @@ -36,7 +36,7 @@ public class Vala.CCodeInitializerList : CCodeExpression { public void append (CCodeExpression expr) { initializers.add (expr); } - + public override void write (CCodeWriter writer) { writer.write_string ("{"); @@ -47,7 +47,7 @@ public class Vala.CCodeInitializerList : CCodeExpression { } else { first = false; } - + if (expr != null) { expr.write (writer); } diff --git a/ccode/valaccodelabel.vala b/ccode/valaccodelabel.vala index efb186693..c0a85788f 100644 --- a/ccode/valaccodelabel.vala +++ b/ccode/valaccodelabel.vala @@ -34,7 +34,7 @@ public class Vala.CCodeLabel : CCodeStatement { public CCodeLabel (string name) { this.name = name; } - + public override void write (CCodeWriter writer) { writer.write_indent (); writer.write_string (name); diff --git a/ccode/valaccodelinedirective.vala b/ccode/valaccodelinedirective.vala index 96b0e017b..c5e61114b 100644 --- a/ccode/valaccodelinedirective.vala +++ b/ccode/valaccodelinedirective.vala @@ -30,12 +30,12 @@ public class Vala.CCodeLineDirective : CCodeNode { * The name of the source file to be presumed. */ public string filename { get; set; } - + /** * The line number in the source file to be presumed. */ public int line_number { get; set; } - + public CCodeLineDirective (string _filename, int _line) { filename = _filename; line_number = _line; diff --git a/ccode/valaccodememberaccess.vala b/ccode/valaccodememberaccess.vala index 2935fc15b..2ed1fe9f9 100644 --- a/ccode/valaccodememberaccess.vala +++ b/ccode/valaccodememberaccess.vala @@ -30,29 +30,29 @@ public class Vala.CCodeMemberAccess : CCodeExpression { * The parent of the member. */ public CCodeExpression inner { get; set; } - + /** * The name of the member. */ public string member_name { get; set; } - + /** * Specifies whether the member access happens by pointer dereferencing. */ public bool is_pointer { get; set; } - + public CCodeMemberAccess (CCodeExpression container, string member, bool pointer = false) { inner = container; member_name = member; is_pointer = pointer; } - + public CCodeMemberAccess.pointer (CCodeExpression container, string member) { inner = container; member_name = member; is_pointer = true; } - + public override void write (CCodeWriter writer) { inner.write_inner (writer); if (is_pointer) { diff --git a/ccode/valaccodeoncesection.vala b/ccode/valaccodeoncesection.vala index 10aa861cc..30b9a369e 100644 --- a/ccode/valaccodeoncesection.vala +++ b/ccode/valaccodeoncesection.vala @@ -30,11 +30,11 @@ public class Vala.CCodeOnceSection : CCodeFragment { * The name of the guarding define. */ public string define { get; set; } - + public CCodeOnceSection (string def) { define = def; } - + public override void write (CCodeWriter writer) { writer.write_indent (); writer.write_string ("#ifndef "); @@ -50,7 +50,7 @@ public class Vala.CCodeOnceSection : CCodeFragment { writer.write_string ("#endif"); writer.write_newline (); } - + public override void write_declaration (CCodeWriter writer) { } } diff --git a/ccode/valaccodeparameter.vala b/ccode/valaccodeparameter.vala index 9f1c2e186..b4bc74963 100644 --- a/ccode/valaccodeparameter.vala +++ b/ccode/valaccodeparameter.vala @@ -30,7 +30,7 @@ public class Vala.CCodeParameter : CCodeNode { * The parameter name. */ public string name { get; set; } - + /** * The parameter type. */ diff --git a/ccode/valaccodeparenthesizedexpression.vala b/ccode/valaccodeparenthesizedexpression.vala index 1fe28702f..08b0807b6 100644 --- a/ccode/valaccodeparenthesizedexpression.vala +++ b/ccode/valaccodeparenthesizedexpression.vala @@ -30,14 +30,14 @@ public class Vala.CCodeParenthesizedExpression : CCodeExpression { * The expression in the parenthesis. */ public CCodeExpression inner { get; set; } - + public CCodeParenthesizedExpression (CCodeExpression expr) { inner = expr; } - + public override void write (CCodeWriter writer) { writer.write_string ("("); - + inner.write (writer); writer.write_string (")"); diff --git a/ccode/valaccodereturnstatement.vala b/ccode/valaccodereturnstatement.vala index 15d91b650..50be0ac7f 100644 --- a/ccode/valaccodereturnstatement.vala +++ b/ccode/valaccodereturnstatement.vala @@ -30,15 +30,15 @@ public class Vala.CCodeReturnStatement : CCodeStatement { * The optional expression to return. */ public CCodeExpression? return_expression { get; set; } - + public CCodeReturnStatement (CCodeExpression? expr = null) { return_expression = expr; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("return"); - + if (return_expression != null) { writer.write_string (" "); return_expression.write (writer); diff --git a/ccode/valaccodestruct.vala b/ccode/valaccodestruct.vala index fce7fcba8..50af6a2bf 100644 --- a/ccode/valaccodestruct.vala +++ b/ccode/valaccodestruct.vala @@ -34,11 +34,11 @@ public class Vala.CCodeStruct : CCodeNode { public bool is_empty { get { return declarations.size == 0; } } private List<CCodeDeclaration> declarations = new ArrayList<CCodeDeclaration> (); - + public CCodeStruct (string name) { this.name = name; } - + /** * Adds the specified declaration as member to this struct. * @@ -47,7 +47,7 @@ public class Vala.CCodeStruct : CCodeNode { public void add_declaration (CCodeDeclaration decl) { declarations.add (decl); } - + /** * Adds a variable with the specified type and name to this struct. * @@ -60,7 +60,7 @@ public class Vala.CCodeStruct : CCodeNode { decl.modifiers = modifiers; add_declaration (decl); } - + public override void write (CCodeWriter writer) { writer.write_string ("struct "); writer.write_string (name); diff --git a/ccode/valaccodeswitchstatement.vala b/ccode/valaccodeswitchstatement.vala index 04edaf5f7..ba6534211 100644 --- a/ccode/valaccodeswitchstatement.vala +++ b/ccode/valaccodeswitchstatement.vala @@ -30,11 +30,11 @@ public class Vala.CCodeSwitchStatement : CCodeBlock { * The switch expression. */ public CCodeExpression expression { get; set; } - + public CCodeSwitchStatement (CCodeExpression expression) { this.expression = expression; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("switch ("); diff --git a/ccode/valaccodetypedefinition.vala b/ccode/valaccodetypedefinition.vala index 797c3baf0..f476ad12b 100644 --- a/ccode/valaccodetypedefinition.vala +++ b/ccode/valaccodetypedefinition.vala @@ -30,7 +30,7 @@ public class Vala.CCodeTypeDefinition : CCodeNode { * The type name. */ public string type_name { get; set; } - + /** * The type declarator. */ @@ -40,18 +40,18 @@ public class Vala.CCodeTypeDefinition : CCodeNode { type_name = type; declarator = decl; } - + public override void write (CCodeWriter writer) { } - + public override void write_declaration (CCodeWriter writer) { writer.write_indent (); writer.write_string ("typedef "); - + writer.write_string (type_name); - + writer.write_string (" "); - + declarator.write_declaration (writer); if (CCodeModifiers.DEPRECATED in modifiers) { diff --git a/ccode/valaccodeunaryexpression.vala b/ccode/valaccodeunaryexpression.vala index afcb8c494..548e42181 100644 --- a/ccode/valaccodeunaryexpression.vala +++ b/ccode/valaccodeunaryexpression.vala @@ -30,17 +30,17 @@ public class Vala.CCodeUnaryExpression : CCodeExpression { * The unary operator. */ public CCodeUnaryOperator operator { get; set; } - + /** * The operand. */ public CCodeExpression inner { get; set; } - + public CCodeUnaryExpression (CCodeUnaryOperator op, CCodeExpression expr) { operator = op; inner = expr; } - + public override void write (CCodeWriter writer) { switch (operator) { case CCodeUnaryOperator.PLUS: writer.write_string ("+"); inner.write_inner (writer); break; diff --git a/ccode/valaccodevariabledeclarator.vala b/ccode/valaccodevariabledeclarator.vala index 43372bf6d..17fa478a3 100644 --- a/ccode/valaccodevariabledeclarator.vala +++ b/ccode/valaccodevariabledeclarator.vala @@ -30,7 +30,7 @@ public class Vala.CCodeVariableDeclarator : CCodeDeclarator { * The variable name. */ public string name { get; set; } - + /** * The optional initializer expression. */ diff --git a/ccode/valaccodewhilestatement.vala b/ccode/valaccodewhilestatement.vala index c47a89071..836806e01 100644 --- a/ccode/valaccodewhilestatement.vala +++ b/ccode/valaccodewhilestatement.vala @@ -30,17 +30,17 @@ public class Vala.CCodeWhileStatement : CCodeStatement { * The loop condition. */ public CCodeExpression condition { get; set; } - + /** * The loop body. */ public CCodeStatement body { get; set; } - + public CCodeWhileStatement (CCodeExpression cond, CCodeStatement? stmt = null) { condition = cond; body = stmt; } - + public override void write (CCodeWriter writer) { writer.write_indent (line); writer.write_string ("while ("); diff --git a/ccode/valaccodewriter.vala b/ccode/valaccodewriter.vala index 0215e7590..26b284c4c 100644 --- a/ccode/valaccodewriter.vala +++ b/ccode/valaccodewriter.vala @@ -54,14 +54,14 @@ public class Vala.CCodeWriter { private bool file_exists; private FileStream? stream; - + private int indent; private int current_line_number = 1; private bool using_line_directive; /* at begin of line */ private bool _bol = true; - + public CCodeWriter (string filename, string? source_filename = null) { this.filename = filename; this.source_filename = source_filename; @@ -115,7 +115,7 @@ public class Vala.CCodeWriter { */ public void close () { stream = null; - + if (file_exists) { var changed = true; @@ -133,7 +133,7 @@ public class Vala.CCodeWriter { } catch (FileError e) { // assume changed if mmap comparison doesn't work } - + if (changed) { FileUtils.rename (temp_filename, filename); } else { @@ -149,7 +149,7 @@ public class Vala.CCodeWriter { } } } - + /** * Writes tabs according to the current indent level. */ @@ -169,11 +169,11 @@ public class Vala.CCodeWriter { if (!_bol) { write_newline (); } - + stream.puts (string.nfill (indent, '\t')); _bol = false; } - + /** * Writes n spaces. */ @@ -190,7 +190,7 @@ public class Vala.CCodeWriter { stream.puts (s); _bol = false; } - + /** * Writes a newline. */ @@ -199,7 +199,7 @@ public class Vala.CCodeWriter { current_line_number++; _bol = true; } - + /** * Opens a new block, increasing the indent level. */ @@ -213,18 +213,18 @@ public class Vala.CCodeWriter { write_newline (); indent++; } - + /** * Closes the current block, decreasing the indent level. */ public void write_end_block () { assert (indent > 0); - + indent--; write_indent (); stream.putc ('}'); } - + /** * Writes the specified text as comment. * diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala index 13be80c3a..39a98e45f 100644 --- a/codegen/valaccodearraymodule.vala +++ b/codegen/valaccodearraymodule.vala @@ -75,12 +75,12 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule { cexpr = new CCodeBinaryExpression (CCodeBinaryOperator.MUL, cexpr, csize); } } - + // add extra item to have array NULL-terminated for all reference types if (expr.element_type.data_type != null && expr.element_type.data_type.is_reference_type ()) { cexpr = new CCodeBinaryExpression (CCodeBinaryOperator.PLUS, cexpr, new CCodeConstant ("1")); } - + gnew.add_argument (cexpr); var temp_var = get_temp_variable (expr.value_type, true, expr); @@ -732,7 +732,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule { if (param.direction != ParameterDirection.IN) { length_ctype = "%s*".printf (length_ctype); } - + for (int dim = 1; dim <= array_type.rank; dim++) { var cparam = new CCodeParameter (get_parameter_array_length_cname (param, dim), length_ctype); cparam_map.set (get_param_pos (get_ccode_array_length_pos (param) + 0.01 * dim), cparam); diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 5ff51e6f2..096426254 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -235,7 +235,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public EmitContext base_finalize_context; public EmitContext instance_init_context; public EmitContext instance_finalize_context; - + public CCodeStruct param_spec_struct; public CCodeStruct closure_struct; public CCodeEnum prop_enum; @@ -251,7 +251,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public Set<string> predefined_marshal_set; /* (constant) hash table with all reserved identifiers in the generated code */ Set<string> reserved_identifiers; - + public int next_temp_var_id { get { return emit_context.next_temp_var_id; } set { emit_context.next_temp_var_id = value; } @@ -325,7 +325,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public bool in_plugin = false; public string module_init_param_name; - + public bool gvaluecollector_h_needed; public bool requires_assert; public bool requires_array_free; @@ -718,11 +718,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { public override void visit_source_file (SourceFile source_file) { cfile = new CCodeFile (); - + user_marshal_set = new HashSet<string> (str_hash, str_equal); - + next_regex_id = 0; - + gvaluecollector_h_needed = false; requires_assert = false; requires_array_free = false; @@ -1127,13 +1127,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { var rhs = get_cvalue (f.initializer); if (!is_simple_struct_creation (f, f.initializer)) { // otherwise handled in visit_object_creation_expression - + ccode.add_assignment (lhs, rhs); - + if (f.variable_type is ArrayType && get_ccode_array_length (f)) { var array_type = (ArrayType) f.variable_type; var field_value = get_field_cvalue (f, load_this_parameter ((TypeSymbol) f.parent_symbol)); - + var glib_value = (GLibValue) f.initializer.target_value; if (glib_value.array_length_cvalues != null) { for (int dim = 1; dim <= array_type.rank; dim++) { @@ -1144,14 +1144,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { requires_array_length = true; var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length")); len_call.add_argument (get_cvalue_ (glib_value)); - + ccode.add_assignment (get_array_length_cvalue (field_value, 1), len_call); } else { for (int dim = 1; dim <= array_type.rank; dim++) { ccode.add_assignment (get_array_length_cvalue (field_value, dim), new CCodeConstant ("-1")); } } - + if (array_type.rank == 1 && f.is_internal_symbol ()) { var lhs_array_size = get_array_size_cvalue (field_value); var rhs_array_len = get_array_length_cvalue (field_value, 1); @@ -1178,7 +1178,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { pop_context (); } - + if (requires_destroy (f.variable_type) && instance_finalize_context != null) { push_context (instance_finalize_context); ccode.add_expression (destroy_field (f, load_this_parameter ((TypeSymbol) f.parent_symbol))); @@ -2094,7 +2094,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { var unref_fun = new CCodeFunction ("block%d_data_unref".printf (block_id), "void"); unref_fun.add_parameter (new CCodeParameter ("_userdata_", "void *")); unref_fun.modifiers = CCodeModifiers.STATIC; - + push_function (unref_fun); ccode.add_declaration (struct_name + "*", new CCodeVariableDeclarator ("_data%d_".printf (block_id), new CCodeCastExpression (new CCodeIdentifier ("_userdata_"), struct_name + "*"))); @@ -2604,7 +2604,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } next_temp_var_id++; - + return local; } @@ -3140,7 +3140,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { generic_elements = (type_arg is GenericType); } } - + if (elements_require_free) { CCodeExpression? cexpr = null; if (element_destroy_func_expression is CCodeIdentifier || element_destroy_func_expression is CCodeMemberAccess) { @@ -3448,7 +3448,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } /* (foo == NULL ? NULL : foo = (unref (foo), NULL)) */ - + /* can be simplified to * foo = (unref (foo), NULL) * if foo is of static type non-null @@ -3511,10 +3511,10 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } } } - + ccomma.append_expression (ccall); ccomma.append_expression (new CCodeConstant ("NULL")); - + var cassign = new CCodeAssignment (cvar, ccomma); // g_free (NULL) is allowed @@ -3526,7 +3526,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { return new CCodeConditionalExpression (cisnull, new CCodeConstant ("NULL"), cassign); } - + public override void visit_end_full_expression (Expression expr) { /* expr is a full expression, i.e. an initializer, the * expression in an expression statement, the controlling @@ -3551,7 +3551,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { temp_ref_values.clear (); } - + public void emit_temp_var (LocalVariable local) { var init = (!local.name.has_prefix ("*") && local.init); if (is_in_coroutine ()) { @@ -3857,7 +3857,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { var inner_node = ((MemberAccess)resource).inner; var member = resource.symbol_reference; var parent = (TypeSymbol)resource.symbol_reference.parent_symbol; - + if (member.is_instance_member ()) { if (inner_node == null) { l = new CCodeIdentifier ("self"); @@ -3888,7 +3888,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } return l; } - + public override void visit_lock_statement (LockStatement stmt) { var l = get_lock_expression (stmt, stmt.resource); @@ -3897,13 +3897,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { ccode.add_expression (fc); } - + public override void visit_unlock_statement (UnlockStatement stmt) { var l = get_lock_expression (stmt, stmt.resource); - + var fc = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_name (mutex_type.scope.lookup ("unlock")))); fc.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, l)); - + ccode.add_expression (fc); } @@ -4156,17 +4156,17 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { // return previous value expr.target_value = temp_value; } - + private MemberAccess? find_property_access (Expression expr) { if (!(expr is MemberAccess)) { return null; } - + var ma = (MemberAccess) expr; if (ma.symbol_reference is Property) { return ma; } - + return null; } @@ -4310,7 +4310,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { * ref (expr) * if static type of expr is non-null */ - + var dupexpr = get_dup_func_expression (type, node.source_reference); if (dupexpr == null) { @@ -4358,7 +4358,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { if (!(type is ArrayType) && get_non_null (value) && !is_ref_function_void (type)) { // expression is non-null ccall.add_argument (cexpr); - + return store_temp_value (new GLibValue (type, ccall), node); } else { var cnotnull = new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, cexpr, new CCodeConstant ("NULL")); @@ -4775,14 +4775,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { cexpr = handle_struct_argument (null, arg, cexpr); arg_pos = get_param_pos (i, ellipsis); } - + carg_map.set (arg_pos, cexpr); i++; } if (params_it.next ()) { var param = params_it.get (); - + /* if there are more parameters than arguments, * the additional parameter is an ellipsis parameter * otherwise there is a bug in the semantic analyzer @@ -5315,7 +5315,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } } } - + public override void visit_named_argument (NamedArgument expr) { set_cvalue (expr, get_cvalue (expr.inner)); } @@ -5363,7 +5363,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } } else { ccode.add_assignment (get_cvalue (expr.inner), new CCodeConstant ("NULL")); - } + } } public override void visit_binary_expression (BinaryExpression expr) { @@ -5459,7 +5459,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } else { assert_not_reached (); } - + if (expr.operator == BinaryOperator.EQUALITY || expr.operator == BinaryOperator.INEQUALITY) { var left_type = expr.left.target_type; @@ -5904,7 +5904,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { array_needs_copy = requires_copy (target_array.element_type); } } - + if (!gvalue_boxing && !gvariant_boxing && target_type.value_owned && (!type.value_owned || boxing || unboxing || array_needs_copy) && requires_copy (target_type) && !(type is NullType)) { // need to copy value var copy = (GLibValue) copy_value (result, node); @@ -5964,7 +5964,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { var base_class = (Class) prop.base_property.parent_symbol; var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_class, null)))); vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (current_class, null)))); - + var ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, "set_%s".printf (prop.name))); ccall.add_argument ((CCodeExpression) get_ccodenode (instance)); var cexpr = get_cvalue_ (value); @@ -5992,7 +5992,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } var set_func = "g_object_set"; - + var base_property = prop; if (!get_ccode_no_accessor_method (prop)) { if (prop.base_property != null) { @@ -6016,7 +6016,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } } } - + var ccall = new CCodeFunctionCall (new CCodeIdentifier (set_func)); if (prop.binding == MemberBinding.INSTANCE) { @@ -6135,7 +6135,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } return null; } - + private void create_property_type_check_statement (Property prop, bool check_return_type, TypeSymbol t, bool non_null, string var_name) { if (check_return_type) { create_type_check_statement (prop, prop.property_type, t, non_null, var_name); diff --git a/codegen/valaccodecontrolflowmodule.vala b/codegen/valaccodecontrolflowmodule.vala index 91268e7d1..6b5505b12 100644 --- a/codegen/valaccodecontrolflowmodule.vala +++ b/codegen/valaccodecontrolflowmodule.vala @@ -145,7 +145,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule { n++; } - + if (default_section != null) { if (n > 0) { ccode.add_else (); @@ -228,7 +228,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule { visit_local_variable (collection_backup); ccode.add_assignment (get_variable_cexpression (get_local_cname (collection_backup)), get_cvalue (stmt.collection)); - + if (stmt.tree_can_fail && stmt.collection.tree_can_fail) { // exception handling add_simple_check (stmt.collection); @@ -245,7 +245,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule { var iterator_variable = new LocalVariable (int_type.copy (), stmt.variable_name + "_it"); visit_local_variable (iterator_variable); var it_name = get_local_cname (iterator_variable); - + var ccond = new CCodeBinaryExpression (CCodeBinaryOperator.LESS_THAN, get_variable_cexpression (it_name), array_len); ccode.open_for (new CCodeAssignment (get_variable_cexpression (it_name), new CCodeConstant ("0")), @@ -278,7 +278,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule { var iterator_variable = new LocalVariable (collection_type.copy (), stmt.variable_name + "_it"); visit_local_variable (iterator_variable); var it_name = get_local_cname (iterator_variable); - + var ccond = new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, get_variable_cexpression (it_name), new CCodeConstant ("NULL")); ccode.open_for (new CCodeAssignment (get_variable_cexpression (it_name), get_variable_cexpression (get_local_cname (collection_backup))), diff --git a/codegen/valaccodedelegatemodule.vala b/codegen/valaccodedelegatemodule.vala index 13a402568..82202c97a 100644 --- a/codegen/valaccodedelegatemodule.vala +++ b/codegen/valaccodedelegatemodule.vala @@ -60,12 +60,12 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule { // handle array parameters if (get_ccode_array_length (param) && param.variable_type is ArrayType) { var array_type = (ArrayType) param.variable_type; - + var length_ctype = "int"; if (param.direction != ParameterDirection.IN) { length_ctype = "int*"; } - + for (int dim = 1; dim <= array_type.rank; dim++) { cparam = new CCodeParameter (get_parameter_array_length_cname (param, dim), length_ctype); cfundecl.add_parameter (cparam); diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala index f4eae3cee..71702a9c1 100644 --- a/codegen/valaccodememberaccessmodule.vala +++ b/codegen/valaccodememberaccessmodule.vala @@ -25,7 +25,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { public override void visit_member_access (MemberAccess expr) { CCodeExpression pub_inst = null; - + if (expr.inner != null) { pub_inst = get_cvalue (expr.inner); } @@ -53,7 +53,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { var base_class = (Class) m.base_method.parent_symbol; var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_class, null)))); vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (current_class, null)))); - + set_cvalue (expr, new CCodeMemberAccess.pointer (vcast, get_ccode_vfunc_name (m))); return; } else if (m.base_interface_method != null) { @@ -181,7 +181,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { var base_class = (Class) base_prop.parent_symbol; var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_class, null)))); vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (current_class, null)))); - + var ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, "get_%s".printf (prop.name))); ccall.add_argument (get_cvalue (expr.inner)); if (prop.property_type.is_real_non_null_struct_type ()) { diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala index 6ab1597bb..65b455fa5 100644 --- a/codegen/valaccodemethodcallmodule.vala +++ b/codegen/valaccodemethodcallmodule.vala @@ -35,12 +35,12 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { Method m = null; Delegate deleg = null; List<Parameter> params; - + var ma = expr.call as MemberAccess; - + var itype = expr.call.value_type; params = itype.get_parameters (); - + if (itype is MethodType) { assert (ma != null); m = ((MethodType) itype).method_symbol; @@ -238,7 +238,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { } else if (m != null && m.binding == MemberBinding.CLASS) { var cl = (Class) m.parent_symbol; var cast = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_upper_case_name (cl, null) + "_CLASS")); - + CCodeExpression klass; if (ma.inner == null) { if (get_this_type () == null) { @@ -335,7 +335,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { } bool ellipsis = false; - + int i = 1; int arg_pos; Iterator<Parameter> params_it = params.iterator (); @@ -675,7 +675,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { } // append C arguments in the right order - + int last_pos; int min_pos; @@ -838,7 +838,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { params_it = params.iterator (); foreach (Expression arg in expr.get_argument_list ()) { Parameter param = null; - + if (params_it.next ()) { param = params_it.get (); if (param.params_array || param.ellipsis) { @@ -865,7 +865,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { requires_array_length = true; var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length")); len_call.add_argument (get_cvalue_ (unary.inner.target_value)); - + ccode.add_assignment (get_array_length_cvalue (unary.inner.target_value, 1), len_call); } } diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index 1b9c677a3..8caaef347 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -1103,7 +1103,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { vcast = new CCodeIdentifier ("self"); } } - + cname = get_ccode_vfunc_name (m); if (suffix == "_finish" && cname.has_suffix ("_async")) { cname = cname.substring (0, cname.length - "_async".length); @@ -1202,7 +1202,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { return; } } - + ccode.add_expression (ccheck); } diff --git a/codegen/valaclassregisterfunction.vala b/codegen/valaclassregisterfunction.vala index dcff2ed63..b4906d5de 100644 --- a/codegen/valaclassregisterfunction.vala +++ b/codegen/valaclassregisterfunction.vala @@ -40,11 +40,11 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { public ClassRegisterFunction (Class cl) { class_reference = cl; } - + public override TypeSymbol get_type_declaration () { return class_reference; } - + public override string get_type_struct_name () { return "%sClass".printf (get_ccode_name (class_reference)); } @@ -76,15 +76,15 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { public override string get_class_init_func_name () { return "%s_class_init".printf (get_ccode_lower_case_name (class_reference, null)); } - + public override string get_instance_struct_size () { return "sizeof (%s)".printf (get_ccode_name (class_reference)); } - + public override string get_instance_init_func_name () { return "%s_instance_init".printf (get_ccode_lower_case_name (class_reference, null)); } - + public override string get_parent_type_name () { return get_ccode_type_id (class_reference.base_class); } @@ -151,22 +151,22 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { public override CCodeFragment get_type_interface_init_declaration () { var frag = new CCodeFragment (); - + foreach (DataType base_type in class_reference.get_base_types ()) { if (!(base_type.data_type is Interface)) { continue; } - + var iface = (Interface) base_type.data_type; - + var iface_info_name = "%s_info".printf (get_ccode_lower_case_name (iface, null)); - + var ctypedecl = new CCodeDeclaration ("const GInterfaceInfo"); ctypedecl.modifiers = CCodeModifiers.STATIC; ctypedecl.add_declarator (new CCodeVariableDeclarator (iface_info_name, new CCodeConstant ("{ (GInterfaceInitFunc) %s_%s_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}".printf (get_ccode_lower_case_name (class_reference), get_ccode_lower_case_name (iface))))); frag.append (ctypedecl); } - + return frag; } @@ -175,9 +175,9 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { if (!(base_type.data_type is Interface)) { continue; } - + var iface = (Interface) base_type.data_type; - + var iface_info_name = "%s_info".printf (get_ccode_lower_case_name (iface, null)); if (!plugin) { var reg_call = new CCodeFunctionCall (new CCodeIdentifier ("g_type_add_interface_static")); @@ -194,7 +194,7 @@ public class Vala.ClassRegisterFunction : TypeRegisterFunction { block.add_statement (new CCodeExpressionStatement (reg_call)); } } - + ((CCodeBaseModule) context.codegen).register_dbus_info (block, class_reference); } } diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala index bd814f08e..d0de35052 100644 --- a/codegen/valagirwriter.vala +++ b/codegen/valagirwriter.vala @@ -1090,7 +1090,7 @@ public class Vala.GIRWriter : CodeVisitor { write_indent (); buffer.append_printf ("</%s>\n", tag_name); } - + public override void visit_creation_method (CreationMethod m) { if (m.external_package) { return; @@ -1194,7 +1194,7 @@ public class Vala.GIRWriter : CodeVisitor { if (sig.emitter != null) { sig.emitter.accept (this); } - + write_indent (); buffer.append_printf ("<glib:signal name=\"%s\"", get_ccode_name (sig)); write_symbol_attributes (sig); @@ -1214,7 +1214,7 @@ public class Vala.GIRWriter : CodeVisitor { private void write_indent () { int i; - + for (i = 0; i < indent; i++) { buffer.append_c ('\t'); } diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala index d039a867c..82eba0774 100644 --- a/codegen/valagobjectmodule.vala +++ b/codegen/valagobjectmodule.vala @@ -58,7 +58,7 @@ public class Vala.GObjectModule : GTypeModule { if (class_has_writable_properties (cl) || cl.get_type_parameters ().size > 0) { ccode.add_assignment (new CCodeMemberAccess.pointer (ccall, "set_property"), new CCodeIdentifier ("_vala_%s_set_property".printf (get_ccode_lower_case_name (cl, null)))); } - + /* set constructor */ if (cl.constructor != null) { var ccast = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_CLASS")); @@ -192,7 +192,7 @@ public class Vala.GObjectModule : GTypeModule { get_prop.add_parameter (new CCodeParameter ("pspec", "GParamSpec *")); push_function (get_prop); - + CCodeFunctionCall ccall = generate_instance_cast (new CCodeIdentifier ("object"), cl); ccode.add_declaration ("%s *".printf (get_ccode_name (cl)), new CCodeVariableDeclarator ("self", ccall)); @@ -290,7 +290,7 @@ public class Vala.GObjectModule : GTypeModule { cfile.add_function_declaration (get_prop); cfile.add_function (get_prop); } - + private void add_set_property_function (Class cl) { var set_prop = new CCodeFunction ("_vala_%s_set_property".printf (get_ccode_lower_case_name (cl, null)), "void"); set_prop.modifiers = CCodeModifiers.STATIC; @@ -300,7 +300,7 @@ public class Vala.GObjectModule : GTypeModule { set_prop.add_parameter (new CCodeParameter ("pspec", "GParamSpec *")); push_function (set_prop); - + CCodeFunctionCall ccall = generate_instance_cast (new CCodeIdentifier ("object"), cl); ccode.add_declaration ("%s *".printf (get_ccode_name (cl)), new CCodeVariableDeclarator ("self", ccall)); @@ -442,11 +442,11 @@ public class Vala.GObjectModule : GTypeModule { var function = new CCodeFunction ("%s_constructor".printf (get_ccode_lower_case_name (cl, null)), "GObject *"); function.modifiers = CCodeModifiers.STATIC; - + function.add_parameter (new CCodeParameter ("type", "GType")); function.add_parameter (new CCodeParameter ("n_construct_properties", "guint")); function.add_parameter (new CCodeParameter ("construct_properties", "GObjectConstructParam *")); - + cfile.add_function_declaration (function); push_function (function); @@ -705,7 +705,7 @@ public class Vala.GObjectModule : GTypeModule { inst_ma.target_value = new GLibValue (get_data_type_for_symbol ((Class) prop.parent_symbol), new CCodeIdentifier ("self"), true); store_property (prop, inst_ma, prop.initializer.target_value); - temp_ref_values.clear (); + temp_ref_values.clear (); pop_context (); } } diff --git a/codegen/valagsignalmodule.vala b/codegen/valagsignalmodule.vala index 4f99941d6..7bf71f344 100644 --- a/codegen/valagsignalmodule.vala +++ b/codegen/valagsignalmodule.vala @@ -35,9 +35,9 @@ public class Vala.GSignalModule : GObjectModule { prefix = "g_cclosure_user_marshal"; } } - + ret = "%s_%s_".printf (prefix, get_ccode_marshaller_type_name (return_type)); - + if (params == null || params.size == 0) { ret = ret + "_VOID"; } else { @@ -45,10 +45,10 @@ public class Vala.GSignalModule : GObjectModule { ret = "%s_%s".printf (ret, get_ccode_marshaller_type_name (p).replace (",", "_")); } } - + return ret; } - + private string? get_value_type_name_from_type_reference (DataType t) { if (t is PointerType || t is GenericType) { return "gpointer"; @@ -74,10 +74,10 @@ public class Vala.GSignalModule : GObjectModule { } else if (t is ErrorType) { return "gpointer"; } - + return null; } - + private string? get_value_type_name_from_parameter (Parameter p) { if (p.direction != ParameterDirection.IN) { return "gpointer"; @@ -85,10 +85,10 @@ public class Vala.GSignalModule : GObjectModule { return get_value_type_name_from_type_reference (p.variable_type); } } - + private string get_marshaller_signature (List<Parameter> params, DataType return_type) { string signature; - + signature = "%s:".printf (get_ccode_marshaller_type_name (return_type)); if (params == null || params.size == 0) { signature = signature + "VOID"; @@ -103,7 +103,7 @@ public class Vala.GSignalModule : GObjectModule { } } } - + return signature; } @@ -198,16 +198,16 @@ public class Vala.GSignalModule : GObjectModule { void generate_marshaller (List<Parameter> params, DataType return_type) { string signature; int n_params, i; - + /* check whether a signal with the same signature already exists for this source file (or predefined) */ signature = get_marshaller_signature (params, return_type); if (predefined_marshal_set.contains (signature) || user_marshal_set.contains (signature)) { return; } - + var signal_marshaller = new CCodeFunction (get_marshaller_function (params, return_type, null), "void"); signal_marshaller.modifiers = CCodeModifiers.STATIC; - + signal_marshaller.add_parameter (new CCodeParameter ("closure", "GClosure *")); signal_marshaller.add_parameter (new CCodeParameter ("return_value", "GValue *")); signal_marshaller.add_parameter (new CCodeParameter ("n_param_values", "guint")); @@ -244,7 +244,7 @@ public class Vala.GSignalModule : GObjectModule { if (return_type.data_type != null || return_type.is_array ()) { ccode.add_declaration (get_value_type_name_from_type_reference (return_type), new CCodeVariableDeclarator ("v_return")); - + fc = new CCodeFunctionCall (new CCodeIdentifier ("g_return_if_fail")); fc.add_argument (new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, new CCodeIdentifier ("return_value"), new CCodeConstant ("NULL"))); ccode.add_expression (fc); @@ -268,7 +268,7 @@ public class Vala.GSignalModule : GObjectModule { var c_assign_rhs = new CCodeCastExpression (new CCodeConditionalExpression (new CCodeIdentifier ("marshal_data"), new CCodeIdentifier ("marshal_data"), new CCodeMemberAccess (new CCodeIdentifier ("cc"), "callback", true)), get_marshaller_function (params, return_type, "GMarshalFunc")); ccode.add_assignment (new CCodeIdentifier ("callback"), c_assign_rhs); - + fc = new CCodeFunctionCall (new CCodeIdentifier ("callback")); fc.add_argument (new CCodeIdentifier ("data1")); i = 1; @@ -306,10 +306,10 @@ public class Vala.GSignalModule : GObjectModule { } } fc.add_argument (new CCodeIdentifier ("data2")); - + if (return_type.data_type != null || return_type.is_array ()) { ccode.add_assignment (new CCodeIdentifier ("v_return"), fc); - + CCodeFunctionCall set_fc; if (return_type.is_array ()) { if (((ArrayType) return_type).element_type.data_type == string_type.data_type) { @@ -332,14 +332,14 @@ public class Vala.GSignalModule : GObjectModule { } set_fc.add_argument (new CCodeIdentifier ("return_value")); set_fc.add_argument (new CCodeIdentifier ("v_return")); - + ccode.add_expression (set_fc); } else { ccode.add_expression (fc); } - + pop_function (); - + cfile.add_function_declaration (signal_marshaller); cfile.add_function (signal_marshaller); user_marshal_set.add (signature); @@ -530,20 +530,20 @@ public class Vala.GSignalModule : GObjectModule { public override void visit_member_access (MemberAccess expr) { if (expr.symbol_reference is Signal) { CCodeExpression pub_inst = null; - + if (expr.inner != null) { pub_inst = get_cvalue (expr.inner); } var sig = (Signal) expr.symbol_reference; var cl = (TypeSymbol) sig.parent_symbol; - + if (expr.inner is BaseAccess && sig.is_virtual) { var m = sig.default_handler; var base_class = (Class) m.parent_symbol; var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_class, null)))); vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (current_class)))); - + set_cvalue (expr, new CCodeMemberAccess.pointer (vcast, m.name)); return; } @@ -574,7 +574,7 @@ public class Vala.GSignalModule : GObjectModule { ccall.add_argument (pub_inst); ccall.add_argument (get_signal_canonical_constant (sig)); - + set_cvalue (expr, ccall); } } else { diff --git a/codegen/valagtkmodule.vala b/codegen/valagtkmodule.vala index 5d3299d5f..309d1378e 100644 --- a/codegen/valagtkmodule.vala +++ b/codegen/valagtkmodule.vala @@ -193,7 +193,7 @@ public class Vala.GtkModule : GSignalModule { // detailed signal, we don't care about the detail signal_name = signal_name.substring (0, sep_idx); } - + var sig = SemanticAnalyzer.symbol_lookup_inherited (current_class, signal_name.replace ("-", "_")) as Signal; if (sig != null) { current_handler_to_signal_map.set (handler_name, sig); @@ -326,7 +326,7 @@ public class Vala.GtkModule : GSignalModule { ccode.add_expression (call); pop_context (); - + if (!field_class.external && !field_class.external_package) { current_required_app_classes.add (field_class); } @@ -387,7 +387,7 @@ public class Vala.GtkModule : GSignalModule { call.add_argument (get_type_id_expression (SemanticAnalyzer.get_data_type_for_symbol (req))); ccode.add_expression (call); } - + var call = new CCodeFunctionCall (new CCodeIdentifier ("gtk_widget_init_template")); call.add_argument (new CCodeIdentifier ("GTK_WIDGET (self)")); ccode.add_expression (call); diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala index 7a4dcabdf..3e553ec7e 100644 --- a/codegen/valagtypemodule.vala +++ b/codegen/valagtypemodule.vala @@ -720,7 +720,7 @@ public class Vala.GTypeModule : GErrorModule { add_interface_init_function (cl, (Interface) base_type.data_type); } } - + add_instance_init_function (cl); if (!cl.is_compact && (cl.get_fields ().size > 0 || cl.destructor != null || cl.is_fundamental ())) { @@ -830,7 +830,7 @@ public class Vala.GTypeModule : GErrorModule { function.modifiers = CCodeModifiers.STATIC; push_function (function); - + var vpointer = new CCodeMemberAccess(new CCodeMemberAccess.pointer (new CCodeIdentifier ("value"), "data[0]"),"v_pointer"); var ccall = new CCodeFunctionCall (new CCodeIdentifier ("%sunref".printf (get_ccode_lower_case_prefix (cl)))); ccall.add_argument (vpointer); @@ -1236,7 +1236,7 @@ public class Vala.GTypeModule : GErrorModule { func.modifiers = CCodeModifiers.STATIC; CCodeFunctionCall ccall; - + /* save pointer to parent class */ var parent_decl = new CCodeDeclaration ("gpointer"); var parent_var_decl = new CCodeVariableDeclarator ("%s_parent_class".printf (get_ccode_lower_case_name (cl, null))); @@ -1251,7 +1251,7 @@ public class Vala.GTypeModule : GErrorModule { ccall.add_argument (new CCodeIdentifier ("klass")); var parent_assignment = new CCodeAssignment (new CCodeIdentifier ("%s_parent_class".printf (get_ccode_lower_case_name (cl, null))), ccall); ccode.add_expression (parent_assignment); - + if (!cl.is_compact && !cl.is_subtype_of (gobject_type) && (cl.get_fields ().size > 0 || cl.destructor != null || cl.is_fundamental ())) { // set finalize function @@ -1310,7 +1310,7 @@ public class Vala.GTypeModule : GErrorModule { continue; } var base_type = prop.base_property.parent_symbol; - + var ccast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (get_ccode_upper_case_name (base_type)))); ccast.add_argument (new CCodeIdentifier ("klass")); @@ -1344,7 +1344,7 @@ public class Vala.GTypeModule : GErrorModule { private void add_class_init_function (Class cl) { cfile.add_function (class_init_context.ccode); } - + private void add_generic_accessor_function (string base_name, string return_type, CCodeExpression? expression, TypeParameter p, Class cl, Interface iface) { string name = "%s_%s_%s".printf (get_ccode_lower_case_name (cl), get_ccode_lower_case_name (iface), base_name); @@ -1372,9 +1372,9 @@ public class Vala.GTypeModule : GErrorModule { iface_init.modifiers = CCodeModifiers.STATIC; push_function (iface_init); - + CCodeFunctionCall ccall; - + /* save pointer to parent vtable */ string parent_iface_var = "%s_%s_parent_iface".printf (get_ccode_lower_case_name (cl), get_ccode_lower_case_name (iface)); var parent_decl = new CCodeDeclaration ("%s *".printf (get_ccode_type_name (iface))); @@ -1396,7 +1396,7 @@ public class Vala.GTypeModule : GErrorModule { if (base_type != iface) { continue; } - + var ciface = new CCodeIdentifier ("iface"); CCodeExpression cfunc; if (m.is_abstract || m.is_virtual) { @@ -1478,7 +1478,7 @@ public class Vala.GTypeModule : GErrorModule { if (base_type != iface) { continue; } - + var ciface = new CCodeIdentifier ("iface"); if (!get_ccode_no_accessor_method (prop.base_interface_property) && !get_ccode_concrete_accessor (prop.base_interface_property)) { @@ -1683,7 +1683,7 @@ public class Vala.GTypeModule : GErrorModule { push_context (instance_init_context); end_instance_init (cl); pop_context (); - + cfile.add_function (instance_init_context.ccode); } @@ -2001,7 +2001,7 @@ public class Vala.GTypeModule : GErrorModule { } else { cspec.call = new CCodeIdentifier ("g_param_spec_pointer"); } - + var pflags = "G_PARAM_STATIC_STRINGS"; if (prop.get_accessor != null && prop.get_accessor.access != SymbolAccessibility.PRIVATE) { pflags = "%s%s".printf (pflags, " | G_PARAM_READABLE"); @@ -2044,7 +2044,7 @@ public class Vala.GTypeModule : GErrorModule { } var type_struct = new CCodeStruct ("_%s".printf (get_ccode_type_name (iface))); - + decl_space.add_type_declaration (new CCodeNewline ()); var macro = "(%s_get_type ())".printf (get_ccode_lower_case_name (iface, null)); decl_space.add_type_declaration (new CCodeMacroReplacement (get_ccode_type_id (iface), macro)); diff --git a/codegen/valagvariantmodule.vala b/codegen/valagvariantmodule.vala index bca03f12c..79c29fdb1 100644 --- a/codegen/valagvariantmodule.vala +++ b/codegen/valagvariantmodule.vala @@ -431,7 +431,7 @@ public class Vala.GVariantModule : GAsyncModule { hash_table_new.add_argument (new CCodeIdentifier ("g_direct_hash")); hash_table_new.add_argument (new CCodeIdentifier ("g_direct_equal")); } - + if (key_type.data_type.is_subtype_of (string_type.data_type)) { hash_table_new.add_argument (new CCodeIdentifier ("g_free")); } else if (key_type.data_type == gvariant_type) { @@ -441,7 +441,7 @@ public class Vala.GVariantModule : GAsyncModule { } else { hash_table_new.add_argument (new CCodeIdentifier ("NULL")); } - + if (value_type.data_type.is_subtype_of (string_type.data_type)) { hash_table_new.add_argument (new CCodeIdentifier ("g_free")); } else if (value_type.data_type == gvariant_type) { diff --git a/codegen/valainterfaceregisterfunction.vala b/codegen/valainterfaceregisterfunction.vala index 505766900..e2c673229 100644 --- a/codegen/valainterfaceregisterfunction.vala +++ b/codegen/valainterfaceregisterfunction.vala @@ -32,15 +32,15 @@ public class Vala.InterfaceRegisterFunction : TypeRegisterFunction { * Specifies the interface to be registered. */ public weak Interface interface_reference { get; set; } - + public InterfaceRegisterFunction (Interface iface) { interface_reference = iface; } - + public override TypeSymbol get_type_declaration () { return interface_reference; } - + public override string get_type_struct_name () { return get_ccode_type_name (interface_reference); } @@ -64,11 +64,11 @@ public class Vala.InterfaceRegisterFunction : TypeRegisterFunction { public override string get_instance_struct_size () { return "0"; } - + public override string get_instance_init_func_name () { return "NULL"; } - + public override string get_parent_type_name () { return "G_TYPE_INTERFACE"; } @@ -81,11 +81,11 @@ public class Vala.InterfaceRegisterFunction : TypeRegisterFunction { /* register all prerequisites */ foreach (DataType prereq_ref in interface_reference.get_prerequisites ()) { var prereq = prereq_ref.data_type; - + var func = new CCodeFunctionCall (new CCodeIdentifier ("g_type_interface_add_prerequisite")); func.add_argument (new CCodeIdentifier ("%s_type_id".printf (get_ccode_lower_case_name (interface_reference)))); func.add_argument (new CCodeIdentifier (get_ccode_type_id (prereq))); - + block.add_statement (new CCodeExpressionStatement (func)); } diff --git a/codegen/valastructregisterfunction.vala b/codegen/valastructregisterfunction.vala index 90234bd11..c210f8631 100644 --- a/codegen/valastructregisterfunction.vala +++ b/codegen/valastructregisterfunction.vala @@ -40,7 +40,7 @@ public class Vala.StructRegisterFunction : TypeRegisterFunction { public StructRegisterFunction (Struct st) { struct_reference = st; } - + public override TypeSymbol get_type_declaration () { return struct_reference; } diff --git a/codegen/valatyperegisterfunction.vala b/codegen/valatyperegisterfunction.vala index 1580c9e8c..51993f358 100644 --- a/codegen/valatyperegisterfunction.vala +++ b/codegen/valatyperegisterfunction.vala @@ -256,7 +256,7 @@ public abstract class Vala.TypeRegisterFunction { definition_fragment.append (fun); } - + /** * Returns the data type to be registered. * @@ -414,7 +414,7 @@ public abstract class Vala.TypeRegisterFunction { */ public virtual void get_type_interface_init_statements (CodeContext context, CCodeBlock block, bool plugin) { } - + public CCodeFragment get_source_declaration () { return source_declaration_fragment; } @@ -427,7 +427,7 @@ public abstract class Vala.TypeRegisterFunction { public CCodeFragment get_declaration () { return declaration_fragment; } - + /** * Returns the definition for this type register function in C code. * diff --git a/gee/timsort.vala b/gee/timsort.vala index e8efa2330..2db14fd3e 100644 --- a/gee/timsort.vala +++ b/gee/timsort.vala @@ -278,7 +278,7 @@ internal class Vala.TimSort<G> { #endif Slice<G> a = (owned) pending[index]; Slice<G> b = (owned) pending[index + 1]; - + assert (a.length > 0); assert (b.length > 0); assert (a.index + a.length == b.index); @@ -648,7 +648,7 @@ internal class Vala.TimSort<G> { this.index = index; this.length = length; } - + ~Slice () { if (new_list != null) free (new_list); diff --git a/libvaladoc/api/attribute.vala b/libvaladoc/api/attribute.vala index da6591992..e138389be 100644 --- a/libvaladoc/api/attribute.vala +++ b/libvaladoc/api/attribute.vala @@ -101,7 +101,7 @@ public class Valadoc.Api.Attribute : Item { } builder.append_attribute ("]"); - + return builder.get (); } } diff --git a/libvaladoc/api/signaturebuilder.vala b/libvaladoc/api/signaturebuilder.vala index a897dae6b..2ad71e9d8 100644 --- a/libvaladoc/api/signaturebuilder.vala +++ b/libvaladoc/api/signaturebuilder.vala @@ -46,7 +46,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds text onto the end of the builder. + * Adds text onto the end of the builder. * * @param text a string * @param spaced add a space at the front of the string if necessary @@ -59,7 +59,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds text onto the end of the builder. + * Adds text onto the end of the builder. * * @param text a string * @param spaced add a space at the front of the string if necessary @@ -72,7 +72,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds highlighted text onto the end of the builder. + * Adds highlighted text onto the end of the builder. * * @param text a string * @param spaced add a space at the front of the string if necessary @@ -86,7 +86,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a Inline onto the end of the builder. + * Adds a Inline onto the end of the builder. * * @param content a content * @param spaced add a space at the front of the inline if necessary @@ -101,7 +101,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a keyword onto the end of the builder. + * Adds a keyword onto the end of the builder. * * @param keyword a keyword * @param spaced add a space at the front of the keyword if necessary @@ -114,7 +114,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a symbol onto the end of the builder. + * Adds a symbol onto the end of the builder. * * @param node a node * @param spaced add a space at the front of the node if necessary @@ -127,7 +127,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a type onto the end of the builder. + * Adds a type onto the end of the builder. * * @param node a node * @param spaced add a space at the front of the node if necessary @@ -145,7 +145,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a type name onto the end of the builder. + * Adds a type name onto the end of the builder. * * @param name a type name * @param spaced add a space at the front of the type name if necessary @@ -158,7 +158,7 @@ public class Valadoc.Api.SignatureBuilder { } /** - * Adds a literal onto the end of the builder. + * Adds a literal onto the end of the builder. * * @param literal a literal * @param spaced add a space at the front of the literal if necessary diff --git a/libvaladoc/api/sourcecomment.vala b/libvaladoc/api/sourcecomment.vala index 2d8eb1485..710e411ed 100644 --- a/libvaladoc/api/sourcecomment.vala +++ b/libvaladoc/api/sourcecomment.vala @@ -27,7 +27,7 @@ public class Valadoc.Api.SourceComment { public SourceFile file { private set; - get; + get; } /** diff --git a/libvaladoc/api/tree.vala b/libvaladoc/api/tree.vala index b505fafcd..833aea529 100644 --- a/libvaladoc/api/tree.vala +++ b/libvaladoc/api/tree.vala @@ -181,7 +181,7 @@ public class Valadoc.Api.Tree { _cresolver = new CTypeResolver (this); } - return _cresolver.resolve_symbol_type (cname); + return _cresolver.resolve_symbol_type (cname); } public Node? search_symbol_cstr (Node? element, string cname) { diff --git a/libvaladoc/api/typeparameter.vala b/libvaladoc/api/typeparameter.vala index 9cfe86482..e28215804 100644 --- a/libvaladoc/api/typeparameter.vala +++ b/libvaladoc/api/typeparameter.vala @@ -34,7 +34,7 @@ public class Valadoc.Api.TypeParameter : Symbol { /** * {@inheritDoc} - */ + */ protected override Inline build_signature () { return new SignatureBuilder () .append_symbol (this) @@ -43,12 +43,12 @@ public class Valadoc.Api.TypeParameter : Symbol { /** * {@inheritDoc} - */ + */ public override NodeType node_type { get { return NodeType.TYPE_PARAMETER; } } /** * {@inheritDoc} - */ + */ public override void accept (Visitor visitor) { visitor.visit_type_parameter (this); } diff --git a/libvaladoc/api/typereference.vala b/libvaladoc/api/typereference.vala index 3fd975c4b..5f29f293f 100644 --- a/libvaladoc/api/typereference.vala +++ b/libvaladoc/api/typereference.vala @@ -120,7 +120,7 @@ public class Valadoc.Api.TypeReference : Item { /** * {@inheritDoc} - */ + */ protected override Inline build_signature () { var signature = new SignatureBuilder (); diff --git a/libvaladoc/content/link.vala b/libvaladoc/content/link.vala index 4e91aabe2..c48429c41 100644 --- a/libvaladoc/content/link.vala +++ b/libvaladoc/content/link.vala @@ -47,7 +47,7 @@ public class Valadoc.Content.Link : InlineContent, Inline { public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) { - + // Internal gktdoc-id? (gir-importer) if (id_registrar != null) { Api.Node? node = id_registrar.map_symbol_id (url); @@ -61,7 +61,7 @@ public class Valadoc.Content.Link : InlineContent, Inline { replacement.check (api_root, container, file_path, reporter, settings); _parent.replace_node (this, replacement); return ; - } + } string _url = id_registrar.map_url_id (url); diff --git a/libvaladoc/content/run.vala b/libvaladoc/content/run.vala index c2228b76a..d2edd1650 100644 --- a/libvaladoc/content/run.vala +++ b/libvaladoc/content/run.vala @@ -37,7 +37,7 @@ public class Valadoc.Content.Run : InlineContent, Inline { LANG_PREPROCESSOR, LANG_COMMENT, LANG_ESCAPE, - + XML_ESCAPE, XML_ELEMENT, XML_ATTRIBUTE, @@ -60,7 +60,7 @@ public class Valadoc.Content.Run : InlineContent, Inline { return Style.UNDERLINED; case "monospaced": - return Style.MONOSPACED; + return Style.MONOSPACED; case "stroke": return Style.STROKE; diff --git a/libvaladoc/documentation/documentationparser.vala b/libvaladoc/documentation/documentationparser.vala index 4a9c0c9bd..b6c28d075 100644 --- a/libvaladoc/documentation/documentationparser.vala +++ b/libvaladoc/documentation/documentationparser.vala @@ -71,7 +71,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { private CommentScanner _comment_scanner; private Parser _wiki_parser; private Parser _comment_parser; - + private Parser _parser; private Scanner _scanner; @@ -331,7 +331,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { Rule.many ({ TokenType.SPACE }) }); - Rule optional_spaces = + Rule optional_spaces = Rule.option ({ Rule.many ({ TokenType.SPACE.action (add_content_space) @@ -415,7 +415,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { //TODO: Find a nicer way to allow empty tags (''run?'' won't work) Rule bold = Rule.seq ({ - TokenType.SINGLE_QUOTE_2, + TokenType.SINGLE_QUOTE_2, Rule.one_of ({ TokenType.SINGLE_QUOTE_2, Rule.seq ({ optional_spaces, run, TokenType.SINGLE_QUOTE_2 }) @@ -859,7 +859,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator { Rule? taglet_rule; if (taglet is BlockContent) { - taglet_rule = taglet.get_parser_rule (multiline_block_run); + taglet_rule = taglet.get_parser_rule (multiline_block_run); } else { taglet_rule = taglet.get_parser_rule (multiline_run); } diff --git a/libvaladoc/documentation/gtkdoccommentparser.vala b/libvaladoc/documentation/gtkdoccommentparser.vala index ede991ce8..20535b764 100644 --- a/libvaladoc/documentation/gtkdoccommentparser.vala +++ b/libvaladoc/documentation/gtkdoccommentparser.vala @@ -515,7 +515,7 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { next (); ListItem item = factory.create_list_item (); - + item.content.add_all (parse_mixed_content ()); if (!check_xml_close_tag ("listitem")) { @@ -1307,7 +1307,7 @@ public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator { } parse_docbook_spaces (); - ListItem? desc = parse_docbook_listitem (); + ListItem? desc = parse_docbook_listitem (); if (desc == null) { return null; } diff --git a/libvaladoc/documentation/gtkdoccommentscanner.vala b/libvaladoc/documentation/gtkdoccommentscanner.vala index d81bc9156..d9b638227 100644 --- a/libvaladoc/documentation/gtkdoccommentscanner.vala +++ b/libvaladoc/documentation/gtkdoccommentscanner.vala @@ -213,7 +213,7 @@ public class Valadoc.Gtkdoc.Scanner { builder.append_c ('>'); } } - } + } if (&txt == &start) { return txt; @@ -359,7 +359,7 @@ public class Valadoc.Gtkdoc.Scanner { unowned string start = this.pos; int column_start = this.column; - next_char (); + next_char (); int id_len = 0; @@ -387,12 +387,12 @@ public class Valadoc.Gtkdoc.Scanner { } } else if (this.pos.has_prefix ("->") || this.pos.has_prefix (".")) { unowned string sep_start = this.pos; - int sep_column_start = this.column; + int sep_column_start = this.column; int separator_len = 1; if (this.pos.has_prefix ("->")) { separator_len = 2; - next_char (); + next_char (); } next_char (); @@ -425,11 +425,11 @@ public class Valadoc.Gtkdoc.Scanner { private inline Token? gtkdoc_property_prefix () { if (get () != ':') { return null; - } + } unowned string start = this.pos; int column_start = this.column; - next_char (); + next_char (); int id_len = 0; @@ -452,7 +452,7 @@ public class Valadoc.Gtkdoc.Scanner { private inline Token? gtkdoc_signal_prefix () { if (get () != ':') { return null; - } + } unowned string start = this.pos; int column_start = this.column; @@ -464,7 +464,7 @@ public class Valadoc.Gtkdoc.Scanner { start = this.pos; - next_char (); + next_char (); int id_len = 0; diff --git a/libvaladoc/documentation/gtkdocmarkdownparser.vala b/libvaladoc/documentation/gtkdocmarkdownparser.vala index 206abb7f3..ee95c4ea0 100644 --- a/libvaladoc/documentation/gtkdocmarkdownparser.vala +++ b/libvaladoc/documentation/gtkdocmarkdownparser.vala @@ -77,7 +77,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator { Valadoc.TokenType.MARKDOWN_PARAMETER.action ((token) => { Run _run = null; - if (token.value == gir_comment.instance_param_name) { + if (token.value == gir_comment.instance_param_name) { _run = _factory.create_run (Run.Style.LANG_KEYWORD); _run.content.add (_factory.create_text ("this")); } else if (is_error_parameter (token.value)) { @@ -434,7 +434,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator { .set_start (() => { var siblings = ((BlockContent) peek ()).content; if (siblings.size > 0 && siblings.last () is Content.List) { - push (siblings.last ()); + push (siblings.last ()); } else { Content.List list = _factory.create_list (); list.bullet = Content.List.Bullet.UNORDERED; @@ -463,7 +463,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator { .set_start (() => { var siblings = ((BlockContent) peek ()).content; if (siblings.size > 0 && siblings.last () is Content.List) { - push (siblings.last ()); + push (siblings.last ()); } else { Content.List list = _factory.create_list (); list.bullet = Content.List.Bullet.ORDERED_NUMBER; @@ -529,7 +529,7 @@ public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator { .set_start (() => { push (_factory.create_headline ()); }) .set_reduce (() => { Headline h = (Headline) pop (); - ((BlockContent) peek ()).content.add (h); + ((BlockContent) peek ()).content.add (h); }) .set_name ("Headline"); diff --git a/libvaladoc/documentation/gtkdocmarkdownscanner.vala b/libvaladoc/documentation/gtkdocmarkdownscanner.vala index 6df58d07d..e7afe18b4 100644 --- a/libvaladoc/documentation/gtkdocmarkdownscanner.vala +++ b/libvaladoc/documentation/gtkdocmarkdownscanner.vala @@ -90,7 +90,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { _skip = 0; _current_string.erase (0, -1); contains_at = false; - + states.clear (); push_state (State.NORMAL); } @@ -112,7 +112,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { while (!_stop && _index.get_char () != 0) { unichar c = _index.get_char (); accept (c); - + _index = _index.next_char (); } @@ -120,7 +120,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { // Close open blocks: while (peek_state () != State.NORMAL) { if (peek_state () == State.BLOCK) { - emit_token (Valadoc.TokenType.MARKDOWN_BLOCK_END); + emit_token (Valadoc.TokenType.MARKDOWN_BLOCK_END); pop_state (); } else { close_block (); @@ -140,7 +140,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { // In headline: string? hash = null; - + if (headline_end != null && is_headline_end (ref _index, headline_end, out hash)) { if (hash != null) { emit_token (Valadoc.TokenType.MARKDOWN_HEADLINE_HASH, hash); @@ -275,7 +275,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { _iter = _iter.offset (1); _skip++; } - + if (_iter[0].tolower () == 'f' || _iter[0].tolower () == 'l') { _iter = _iter.offset (1); _skip++; @@ -540,7 +540,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { headline_end = "#"; } else { emit_token (Valadoc.TokenType.MARKDOWN_HEADLINE_2); - _iter = _iter.offset (2); + _iter = _iter.offset (2); headline_end = "##"; } @@ -599,7 +599,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner { unowned string id_start = _iter; int hash_len = 0; - + while (_iter[0] != '}' && _iter[0] != '\n' && _iter[0] != '\0') { _iter = _iter.offset (1); hash_len++; diff --git a/libvaladoc/filehelper.vala b/libvaladoc/filehelper.vala index c9ff9c137..46823bb04 100644 --- a/libvaladoc/filehelper.vala +++ b/libvaladoc/filehelper.vala @@ -26,7 +26,7 @@ namespace Valadoc { public extern const string icons_dir; /** - * Makes a copy of the file src to dest. + * Makes a copy of the file src to dest. * * @param src the file to copy * @param dest the destination path @@ -50,7 +50,7 @@ namespace Valadoc { } /** - * Makes a copy of the directory src to dest. + * Makes a copy of the directory src to dest. * * @param src the directory to copy * @param dest the destination path diff --git a/libvaladoc/gtkdocrenderer.vala b/libvaladoc/gtkdocrenderer.vala index 45211ff1d..6ffc80141 100644 --- a/libvaladoc/gtkdocrenderer.vala +++ b/libvaladoc/gtkdocrenderer.vala @@ -245,7 +245,7 @@ public class Valadoc.GtkdocRenderer : ContentRenderer { } element.accept_children (this); - + writer.end_tag (tag); } diff --git a/libvaladoc/highlighter/xmlscanner.vala b/libvaladoc/highlighter/xmlscanner.vala index 38b87c5ee..8c048b9b4 100644 --- a/libvaladoc/highlighter/xmlscanner.vala +++ b/libvaladoc/highlighter/xmlscanner.vala @@ -270,7 +270,7 @@ public class Valadoc.Highlighter.XmlScanner : Object, Scanner { pos = pos.offset (1); skipped = true; } - + return skipped; } @@ -306,7 +306,7 @@ public class Valadoc.Highlighter.XmlScanner : Object, Scanner { if (pos.has_prefix ("<!--")) { return true; } - + // CDATA: if (pos.has_prefix ("<![CDATA[")) { return true; diff --git a/libvaladoc/importer/internalidregistrar.vala b/libvaladoc/importer/internalidregistrar.vala index fcc1e5a2a..c82241fc5 100644 --- a/libvaladoc/importer/internalidregistrar.vala +++ b/libvaladoc/importer/internalidregistrar.vala @@ -33,7 +33,7 @@ public class Valadoc.Importer.InternalIdRegistrar { symbol_map = new Vala.HashMap<string, Api.Node> (str_hash, str_equal); } - + public void register_symbol (string id, Api.Node symbol) { this.symbol_map.set (id, symbol); } diff --git a/libvaladoc/importer/valadocdocumentationimporter.vala b/libvaladoc/importer/valadocdocumentationimporter.vala index 0663bab1e..48f29185f 100644 --- a/libvaladoc/importer/valadocdocumentationimporter.vala +++ b/libvaladoc/importer/valadocdocumentationimporter.vala @@ -56,7 +56,7 @@ public class Valadoc.Importer.ValadocDocumentationImporter : DocumentationImport _scanner.set_parser (_parser); _comment = new StringBuilder (); - + // init parser rules: Rule unprinted_spaces = Rule.many ({ Rule.one_of ({ diff --git a/libvaladoc/markupwriter.vala b/libvaladoc/markupwriter.vala index 28a61ffe7..4bec5199e 100644 --- a/libvaladoc/markupwriter.vala +++ b/libvaladoc/markupwriter.vala @@ -89,7 +89,7 @@ public class Valadoc.MarkupWriter { /** * Initializes a new instance of the MarkupWriter - * + * * @param write stream a WriteFunc * @param xml_declaration specifies whether this file starts with an xml-declaration */ diff --git a/tests/basic-types/bug571486.vala b/tests/basic-types/bug571486.vala index 4ba922ec2..1240bc515 100644 --- a/tests/basic-types/bug571486.vala +++ b/tests/basic-types/bug571486.vala @@ -13,14 +13,14 @@ class Foo { void main () { Object o1 = new Object (); Object o2 = new Object (); - + (unowned Object)[] test = new (unowned Object)[] { o1 }; assert (o1.ref_count == 1); test[0] = o2; assert (o1.ref_count == 1); assert (o2.ref_count == 1); - - test = null; + + test = null; assert (o1.ref_count == 1); assert (o2.ref_count == 1); diff --git a/tests/basic-types/bug731017.vala b/tests/basic-types/bug731017.vala index 4f25205a7..2359b4807 100644 --- a/tests/basic-types/bug731017.vala +++ b/tests/basic-types/bug731017.vala @@ -8,10 +8,10 @@ string foo = null; void main() { foo = "foo"; - + string[] keys = bar(); foo = null; - + foreach (unowned string k in keys) { assert (k == "foo"); } diff --git a/tests/control-flow/break.vala b/tests/control-flow/break.vala index 9eb35d0a0..8505959ad 100644 --- a/tests/control-flow/break.vala +++ b/tests/control-flow/break.vala @@ -3,15 +3,15 @@ using GLib; class Maman.Bar : Object { public static int main () { stdout.printf ("Break Test: 1"); - + int i; for (i = 0; i < 10; i++) { stdout.printf (" 2"); break; } - + stdout.printf (" 3\n"); - + return 0; } } diff --git a/tests/control-flow/bug691514.vala b/tests/control-flow/bug691514.vala index 661e73c04..4f60c7702 100644 --- a/tests/control-flow/bug691514.vala +++ b/tests/control-flow/bug691514.vala @@ -5,19 +5,19 @@ public string[] test() throws Error { void main() { string t = (true ? "1" : "2") ?? "3"; assert (t == "1"); - + t = (false ? "1" : "2") ?? "3"; assert (t == "2"); - + t = (true ? null : "2") ?? "3"; assert (t == "3"); - + t = (false ? "1" : null) ?? "3"; assert (t == "3"); - + t = test()[0] ?? "2"; assert (t == "2"); - + t = test()[1] ?? "2"; assert (t == "1"); } diff --git a/tests/control-flow/switch.vala b/tests/control-flow/switch.vala index 9ea363fd1..5a1bb24af 100644 --- a/tests/control-flow/switch.vala +++ b/tests/control-flow/switch.vala @@ -18,7 +18,7 @@ class Maman.Bar : Object { for (i = 2; i < 7; i++) { stdout.printf (" %d", i); } - + stdout.printf (" 7\n"); stdout.printf ("Switch statement: 1"); @@ -37,7 +37,7 @@ class Maman.Bar : Object { class Maman.Foo : Object { public void run () { stdout.printf (" 2"); - + switch (23) { case 23: stdout.printf (" 3"); @@ -46,7 +46,7 @@ class Maman.Foo : Object { stdout.printf (" BAD"); break; } - + switch (inc ()) { case 0: stdout.printf (" 4"); @@ -58,7 +58,7 @@ class Maman.Foo : Object { stdout.printf (" BAD"); break; } - + switch (42) { case 0: stdout.printf (" BAD"); @@ -70,14 +70,14 @@ class Maman.Foo : Object { stdout.printf (" BAD"); break; } - + stdout.printf (" 6"); } - + public int inc () { return counter++; } - + private int counter = 0; } diff --git a/tests/delegates/delegates.vala b/tests/delegates/delegates.vala index 34bf1fcb7..03fb9b17f 100644 --- a/tests/delegates/delegates.vala +++ b/tests/delegates/delegates.vala @@ -80,7 +80,7 @@ class Maman.Bar : Object, Foo { public static int main () { stdout.printf ("Delegate Test: 1"); - + VoidCallback void_cb = do_void_action; void_cb (); @@ -88,7 +88,7 @@ class Maman.Bar : Object, Foo { stdout.printf (" 3"); ActionCallback cb = do_action; - + stdout.printf (" %d", cb ()); stdout.printf (" 5"); diff --git a/tests/enums/enums.vala b/tests/enums/enums.vala index c9f913f07..87bb127d0 100644 --- a/tests/enums/enums.vala +++ b/tests/enums/enums.vala @@ -24,7 +24,7 @@ class Maman.Bar : Object { stdout.printf (" %d", Foo.VAL3); stdout.printf (" 4"); - + stdout.printf (" %d", Foo.VAL5); } @@ -40,7 +40,7 @@ class Maman.Bar : Object { public static int main () { stdout.printf ("Enum Test: 1"); - + var bar = new Bar (); bar.run (); diff --git a/tests/errors/errors.vala b/tests/errors/errors.vala index 264e6376d..27f42f974 100644 --- a/tests/errors/errors.vala +++ b/tests/errors/errors.vala @@ -75,7 +75,7 @@ class Maman.Bar : Object { public static int main () { stdout.printf ("Exception Test: 1"); - + var bar = new Bar (); bar.run (); diff --git a/tests/methods/bug652098.vala b/tests/methods/bug652098.vala index d16f27f5d..3cb19cab7 100644 --- a/tests/methods/bug652098.vala +++ b/tests/methods/bug652098.vala @@ -42,14 +42,14 @@ void main () { var obj1 = new Obj1 (); var iface1 = (Iface1) obj1; var iface2 = (Iface2) obj1; - + assert (iface1.foo () == 1); assert (iface2.foo () == 2); var obj2 = new Obj2 (); iface1 = (Iface1) obj2; iface2 = (Iface2) obj2; - + assert (iface1.foo () == 1); assert (iface2.foo () == 2); }
\ No newline at end of file diff --git a/tests/methods/generics.vala b/tests/methods/generics.vala index 27e9cc16e..9b37aeeab 100644 --- a/tests/methods/generics.vala +++ b/tests/methods/generics.vala @@ -27,7 +27,7 @@ void main () { var baz = new Baz (); baz.foo<Object> (bar); assert (baz.ref_count == 1); - + assert (is_check<Bar> ()); assert (!is_check<Baz> ()); } diff --git a/tests/methods/iterator.vala b/tests/methods/iterator.vala index 68d573e35..d2ee2dcc6 100644 --- a/tests/methods/iterator.vala +++ b/tests/methods/iterator.vala @@ -3,7 +3,7 @@ class Foo { class FooIterator { bool called = false; - + public bool next () { return !called; } @@ -23,7 +23,7 @@ class FooCollection { class FooIterator2 { bool called = false; - + public Foo? next_value () { if (called) return null; diff --git a/tests/methods/lambda.vala b/tests/methods/lambda.vala index c659cb65b..00afd9faa 100644 --- a/tests/methods/lambda.vala +++ b/tests/methods/lambda.vala @@ -26,7 +26,7 @@ class Maman.Bar : Object { assert (do_action (i => { return i * 3; }) == 3); assert (do_out_action ((out i) => { i = 4; }) == 4); assert (do_ref_action ((ref i) => { i += 4; }) == 5); - + return 0; } } diff --git a/tests/objects/bug631267.vala b/tests/objects/bug631267.vala index c9576c2cc..296fca86c 100644 --- a/tests/objects/bug631267.vala +++ b/tests/objects/bug631267.vala @@ -12,7 +12,7 @@ class Foo : Object { public FObject o { get; set; } public FStruct t { get; set; } public void* p { get; set; } - + public int foo { get { return i; } } public int bar { set { i = value; } } @@ -27,7 +27,7 @@ void main () { var o = new FObject (); FStruct t = {}; void* p = &o; - + var foo = new Foo (); foo.s = s; foo.a = a; @@ -35,7 +35,7 @@ void main () { foo.o = o; foo.t = t; foo.p = p; - + foo.notify["s"].connect (() => error ("string-type equality failed")); foo.notify["a"].connect (() => error ("array-type equality failed")); foo.notify["i"].connect (() => error ("simple-type equality failed")); diff --git a/tests/objects/bug751338.vala b/tests/objects/bug751338.vala index 04bacac00..353071e9d 100644 --- a/tests/objects/bug751338.vala +++ b/tests/objects/bug751338.vala @@ -10,16 +10,16 @@ public class Foo : Object { void main() { string[]? strings; var f = new Foo(); - + f.set("strings", new string[]{ "foo", "bar" }); f.get("strings", out strings); assert (strings[0] == "foo"); assert (strings[1] == "bar"); - + f.set("strings", null); f.get("strings", out strings); assert(strings == null); - + f.set("strings", new string[]{ "foo", "bar" }); f.get("strings", out strings); assert (strings[0] == "foo"); diff --git a/tests/objects/bug779955.vala b/tests/objects/bug779955.vala index e67ef0ca8..d1ecc3f2d 100644 --- a/tests/objects/bug779955.vala +++ b/tests/objects/bug779955.vala @@ -1,6 +1,6 @@ public class Foo : Object { int i = 42; - + public int bar { get { return i; diff --git a/tests/objects/fields.vala b/tests/objects/fields.vala index 96b66783e..8229e978e 100644 --- a/tests/objects/fields.vala +++ b/tests/objects/fields.vala @@ -15,7 +15,7 @@ class Maman.Bar : Foo { private int private_field = 4; private static int private_static_field = 5; public static int public_static_field = 6; - private class int private_class_field; + private class int private_class_field; public class int public_class_field; class construct { @@ -24,10 +24,10 @@ class Maman.Bar : Foo { static construct { public_class_field = 8; } - + void do_action () { stdout.printf (" %d %d %d %d %d %d %d", public_base_field, public_field, - private_field, private_static_field, public_static_field, + private_field, private_static_field, public_static_field, private_class_field, public_class_field); public_base_field = 9; public_field = 10; @@ -45,12 +45,12 @@ class Maman.Bar : Foo { public_class_field = 15; } stdout.printf (" %d %d %d %d %d %d %d", public_base_field, public_field, - private_field, private_static_field, public_static_field, + private_field, private_static_field, public_static_field, private_class_field, public_class_field); } class void do_action_class () { - stdout.printf (" %d %d %d %d", private_static_field, public_static_field, + stdout.printf (" %d %d %d %d", private_static_field, public_static_field, private_class_field, public_class_field); lock (private_static_field) { private_static_field = 12; @@ -64,13 +64,13 @@ class Maman.Bar : Foo { lock (public_class_field) { public_class_field = 15; } - stdout.printf (" %d %d %d %d", private_static_field, public_static_field, + stdout.printf (" %d %d %d %d", private_static_field, public_static_field, private_class_field, public_class_field); } public static int main () { stdout.printf ("Field Test: 1"); - + var bar = new Bar (); bar.do_action (); bar.do_action_class (); @@ -83,12 +83,12 @@ class Maman.Bar : Foo { bar.private_class_field = 21; ((Foo)bar).public_class_field = 22; stdout.printf (" %d %d %d %d %d %d %d", bar.public_base_field, bar.public_field, - bar.private_field, bar.private_static_field, bar.public_static_field, + bar.private_field, bar.private_static_field, bar.public_static_field, bar.private_class_field, ((Foo)bar).public_class_field); var foo = new Foo (); stdout.printf (" %d", foo.public_class_field); - + var compact = new CompactTest (); stdout.printf (" %d", compact.initialized_field); diff --git a/tests/objects/interfaces.vala b/tests/objects/interfaces.vala index e6895d68b..be4119d51 100644 --- a/tests/objects/interfaces.vala +++ b/tests/objects/interfaces.vala @@ -47,7 +47,7 @@ class Maman.SubBaz : Baz { ibaz.do_action (); ibaz.public_mixin(); (ibaz as Baz).do_mixin(); - + stdout.printf (" 3"); ibaz.do_virtual_action (); diff --git a/tests/objects/methods.vala b/tests/objects/methods.vala index 7217474ca..9a950c322 100644 --- a/tests/objects/methods.vala +++ b/tests/objects/methods.vala @@ -32,7 +32,7 @@ class Maman.SubBar : Bar { var bar = new SubBar (); bar.do_action (); - + stdout.printf (" 3\n"); stdout.printf ("Static Inheritance Test: 1"); @@ -44,7 +44,7 @@ class Maman.SubBar : Bar { stdout.printf ("Virtual Method Test: 1"); bar.do_virtual_action (); - + stdout.printf (" 3\n"); // test symbol resolving to check that methods of implemented @@ -53,7 +53,7 @@ class Maman.SubBar : Bar { var foobar = new SubFooBar (); foobar.do_action (); - + stdout.printf (" 3\n"); test_classes_methods_ref_parameters (); diff --git a/tests/objects/properties.vala b/tests/objects/properties.vala index 1a40e95e0..3d86de106 100644 --- a/tests/objects/properties.vala +++ b/tests/objects/properties.vala @@ -69,7 +69,7 @@ public class Sample : Object { Maman.Ibaz ibaz = new Maman.Baz (); ibaz.simple_method (); - + stdout.printf (" 3\n"); var nonpriv = new NonPrivAccess (); @@ -114,10 +114,10 @@ class Maman.Bar : Foo { public static void run () { stdout.printf ("Property Test: 1"); - + var bar = new Bar (); bar.do_action (); - + Foo foo = bar; foo.abstract_base_property = 6; stdout.printf (" %d", foo.abstract_base_property); diff --git a/tests/objects/signals.vala b/tests/objects/signals.vala index 195f563c8..3e9764d94 100644 --- a/tests/objects/signals.vala +++ b/tests/objects/signals.vala @@ -19,9 +19,9 @@ class Maman.Bar : Object { public void run () { stdout.printf (" 2"); - + var foo = new Foo (); - + foo.activated.connect ((foo, b) => { if (b) { stdout.printf (" 8"); @@ -33,11 +33,11 @@ class Maman.Bar : Object { foo.activated.connect (activated); stdout.printf (" 3"); - + foo.do_action (false); stdout.printf (" 6"); - + foo.activated.disconnect (activated); stdout.printf (" 7"); @@ -59,15 +59,15 @@ class Maman.UserFoo : Object { class Maman.UserBar : Object { public void run () { stdout.printf (" 2"); - + var foo = new UserFoo (); - + foo.activated.connect ((foo, i1, i2) => { stdout.printf (" %d", i1 + i2); }); stdout.printf (" 3"); - + foo.do_action (); stdout.printf (" 5"); diff --git a/tests/objects/test-025.vala b/tests/objects/test-025.vala index 8ffda92cf..af052e277 100644 --- a/tests/objects/test-025.vala +++ b/tests/objects/test-025.vala @@ -24,7 +24,7 @@ class Maman.SubBar : Bar { var bar = new SubBar (); bar.run (); - + stdout.printf (" 5\n"); return 0; diff --git a/tests/objects/test-026.vala b/tests/objects/test-026.vala index 154efadb1..7d4197212 100644 --- a/tests/objects/test-026.vala +++ b/tests/objects/test-026.vala @@ -24,7 +24,7 @@ class Maman.SubBar : Bar { var bar = new SubBar (); bar.run (); - + stdout.printf (" 5\n"); return 0; diff --git a/tests/objects/test-029.vala b/tests/objects/test-029.vala index acc7ec1d7..e923eafd4 100644 --- a/tests/objects/test-029.vala +++ b/tests/objects/test-029.vala @@ -3,23 +3,23 @@ using GLib; class Maman.Foo : Object { public int p1 { get; set; } public int p2 { get; set; } - + public Foo (int i, int p2) { p1 = 2 * i; this.p2 = p2; } - + public static int main () { stdout.printf ("Construct Formal Parameter Test: 1"); - + var foo = new Foo (2, 3); - + stdout.printf (" 2"); stdout.printf (" %d", foo.p2); stdout.printf (" %d", foo.p1); - + stdout.printf (" 5\n"); - + return 0; } } 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); diff --git a/valadoc/doclets/gtkdoc/commentconverter.vala b/valadoc/doclets/gtkdoc/commentconverter.vala index 25e7a0907..be31313ff 100644 --- a/valadoc/doclets/gtkdoc/commentconverter.vala +++ b/valadoc/doclets/gtkdoc/commentconverter.vala @@ -57,7 +57,7 @@ public class Gtkdoc.CommentConverter : ContentVisitor { public override void visit_comment (Content.Comment c) { c.accept_children (this); } - + public override void visit_embedded (Embedded em) { current_builder.append ("<figure>"); if (em.caption != null) { @@ -83,7 +83,7 @@ public class Gtkdoc.CommentConverter : ContentVisitor { hl.accept_children (this); current_builder.append ("\n"); } - + public override void visit_wiki_link (WikiLink link) { // wiki pages are not supported right now if (link.content.size > 0) { @@ -159,13 +159,13 @@ public class Gtkdoc.CommentConverter : ContentVisitor { list.accept_children (this); current_builder.append_printf ("</%s>", tag); } - + public override void visit_list_item (ListItem item) { current_builder.append ("<listitem>"); item.accept_children (this); current_builder.append ("</listitem>"); } - + public override void visit_paragraph (Paragraph para) { if (!in_brief_comment) { current_builder.append ("<para>"); @@ -196,7 +196,7 @@ public class Gtkdoc.CommentConverter : ContentVisitor { public override void visit_page (Page page) { page.accept_children (this); } - + public override void visit_run (Run run) { string? tag = null; switch (run.style) { @@ -226,19 +226,19 @@ public class Gtkdoc.CommentConverter : ContentVisitor { current_builder.append_printf ("</%s>", tag); } } - + public override void visit_source_code (SourceCode code) { current_builder.append ("\n|[\n"); current_builder.append (Markup.escape_text (code.code)); current_builder.append ("\n]|\n"); } - + public override void visit_table (Table t) { current_builder.append ("<table>"); t.accept_children (this); current_builder.append ("</table>"); } - + public override void visit_table_row (TableRow row) { current_builder.append ("<tr>"); row.accept_children (this); @@ -250,7 +250,7 @@ public class Gtkdoc.CommentConverter : ContentVisitor { cell.accept_children (this); current_builder.append ("</td>"); } - + public override void visit_taglet (Taglet t) { var old_builder = (owned)current_builder; current_builder = new StringBuilder (); @@ -296,7 +296,7 @@ public class Gtkdoc.CommentConverter : ContentVisitor { } current_builder = (owned)old_builder; } - + public override void visit_text (Text t) { current_builder.append (Markup.escape_text (t.content)); t.accept_children (this); diff --git a/valadoc/doclets/gtkdoc/generator.vala b/valadoc/doclets/gtkdoc/generator.vala index 09bab21a0..c6f135a8c 100644 --- a/valadoc/doclets/gtkdoc/generator.vala +++ b/valadoc/doclets/gtkdoc/generator.vala @@ -769,7 +769,7 @@ It is important that your <link linkend=\"GValue\"><type>GValue</type></link> ho en.accept_all_children (this); var gcomment = add_symbol (en.get_filename(), en.get_cname(), en.documentation); - + // Handle attributes for things like deprecation. process_attributes (en, gcomment); @@ -903,7 +903,7 @@ It is important that your <link linkend=\"GValue\"><type>GValue</type></link> ho // field not in class/struct/interface var gcomment = add_symbol (f.get_filename(), f.get_cname(), f.documentation); f.accept_all_children (this); - + // Handle attributes for things like deprecation. process_attributes (f, gcomment); } else { @@ -957,7 +957,7 @@ It is important that your <link linkend=\"GValue\"><type>GValue</type></link> ho */ } } - + // Handle attributes for things like deprecation. process_attributes (d, gcomment); diff --git a/valadoc/doclets/gtkdoc/utils.vala b/valadoc/doclets/gtkdoc/utils.vala index be5517204..21ddea664 100644 --- a/valadoc/doclets/gtkdoc/utils.vala +++ b/valadoc/doclets/gtkdoc/utils.vala @@ -257,7 +257,7 @@ public class Gtkdoc.TextWriter { public void close () { stream = null; } - + public void write_line (string line) { stream.puts (line); stream.putc ('\n'); diff --git a/valadoc/symbolresolver.vala b/valadoc/symbolresolver.vala index b60de1683..4980e88ab 100644 --- a/valadoc/symbolresolver.vala +++ b/valadoc/symbolresolver.vala @@ -186,7 +186,7 @@ public class Valadoc.Drivers.SymbolResolver : Visitor { } resolve_type_reference (item.property_type); - + item.accept_all_children (this, false); } diff --git a/valadoc/tests/drivers/generic-api-test.vala b/valadoc/tests/drivers/generic-api-test.vala index 48c54b537..4a1024d24 100644 --- a/valadoc/tests/drivers/generic-api-test.vala +++ b/valadoc/tests/drivers/generic-api-test.vala @@ -182,7 +182,7 @@ public static void test_enum_global (Api.Enum? en, Api.Package pkg, Api.Namespac Api.NodeType.TYPE_PARAMETER }; - Vala.List<Api.Node> nodes = en.get_children_by_types (forbidden, false); + Vala.List<Api.Node> nodes = en.get_children_by_types (forbidden, false); assert (nodes.size == 0); } @@ -339,7 +339,7 @@ public static void test_erroromain_global (Api.ErrorDomain? err, Api.Package pkg Api.NodeType.TYPE_PARAMETER }; - Vala.List<Api.Node> nodes = err.get_children_by_types (forbidden, false); + Vala.List<Api.Node> nodes = err.get_children_by_types (forbidden, false); assert (nodes.size == 0); } @@ -756,7 +756,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp case "field2": // (.Field check) - assert (field.get_cname () == "field2"); + assert (field.get_cname () == "field2"); assert (field.is_static == false); assert (field.is_volatile == false); // (.Symbol check) @@ -833,7 +833,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp Api.NodeType.TYPE_PARAMETER }; - Vala.List<Api.Node> nodes = cl.get_children_by_types (forbidden, false); + Vala.List<Api.Node> nodes = cl.get_children_by_types (forbidden, false); assert (nodes.size == 0); } @@ -1157,7 +1157,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg, Api.NodeType.TYPE_PARAMETER }; - Vala.List<Api.Node> nodes = iface.get_children_by_types (forbidden, false); + Vala.List<Api.Node> nodes = iface.get_children_by_types (forbidden, false); assert (nodes.size == 0); } @@ -1362,7 +1362,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na case "field2": // (.Field check) - assert (field.get_cname () == "field2"); + assert (field.get_cname () == "field2"); assert (field.is_static == false); assert (field.is_volatile == false); // (.Symbol check) @@ -1562,7 +1562,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na Api.NodeType.TYPE_PARAMETER }; - Vala.List<Api.Node> nodes = stru.get_children_by_types (forbidden, false); + Vala.List<Api.Node> nodes = stru.get_children_by_types (forbidden, false); assert (nodes.size == 0); } @@ -1611,7 +1611,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) { Api.NodeType.TYPE_PARAMETER }; - Vala.List<Api.Node> nodes = m.get_children_by_types (forbidden, false); + Vala.List<Api.Node> nodes = m.get_children_by_types (forbidden, false); assert (nodes.size == 0); Vala.List<Api.Node> params = m.get_children_by_type (Api.NodeType.FORMAL_PARAMETER, false); @@ -2325,7 +2325,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) { Api.NodeType.TYPE_PARAMETER }; - Vala.List<Api.Node> nodes = ns.get_children_by_types (forbidden, false); + Vala.List<Api.Node> nodes = ns.get_children_by_types (forbidden, false); assert (nodes.size == 0); } @@ -2370,7 +2370,7 @@ public static void return_test (Api.Namespace ns, Api.Package pkg) { Api.NodeType.TYPE_PARAMETER }; - Vala.List<Api.Node> nodes = m.get_children_by_types (forbidden, false); + Vala.List<Api.Node> nodes = m.get_children_by_types (forbidden, false); assert (nodes.size == 0); Api.TypeReference? ret = m.return_type; @@ -2723,7 +2723,7 @@ public static void test_global_ns (Api.Namespace global_ns, Api.Package pkg) { Api.Field field = fields.get (0) as Api.Field; assert (field != null); // (.Field check) - assert (field.get_cname () == "test_field_global"); + assert (field.get_cname () == "test_field_global"); assert (field.is_static == false); assert (field.is_volatile == false); // (.Symbol check) @@ -2744,7 +2744,7 @@ public static void test_global_ns (Api.Namespace global_ns, Api.Package pkg) { Api.Constant constant = constants.get (0) as Api.Constant; assert (constant != null); // (.Constant check) - assert (constant.get_cname () == "test_const_global"); + assert (constant.get_cname () == "test_const_global"); // (.Symbol check) assert (constant.is_deprecated == false); assert (constant.accessibility == Api.SymbolAccessibility.PUBLIC); diff --git a/valadoc/tests/libvaladoc/gtkdoc-scanner.vala b/valadoc/tests/libvaladoc/gtkdoc-scanner.vala index 164a2a538..f299931da 100644 --- a/valadoc/tests/libvaladoc/gtkdoc-scanner.vala +++ b/valadoc/tests/libvaladoc/gtkdoc-scanner.vala @@ -175,7 +175,7 @@ myword assert (token.type == Gtkdoc.TokenType.WORD); assert (token.content == "myword"); assert (token.attributes == null); - + token = scanner.next (); assert (token.type == Gtkdoc.TokenType.SPACE); diff --git a/valadoc/tests/libvaladoc/markupreader.vala b/valadoc/tests/libvaladoc/markupreader.vala index 363e4b462..426b3a756 100644 --- a/valadoc/tests/libvaladoc/markupreader.vala +++ b/valadoc/tests/libvaladoc/markupreader.vala @@ -26,7 +26,7 @@ using Valadoc; public static void positive_1 () { var reporter = new ErrorReporter (); - string content = + string content = """<?xml version="1.0" ?> <root-element> <subelement level="1" nested="true">my text</subelement> diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala index 4c4cd02cf..a1a7a7773 100644 --- a/valadoc/treebuilder.vala +++ b/valadoc/treebuilder.vala @@ -1492,7 +1492,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor { parent.add_child (node); process_children (node, element); - } + } // |