[vala] Fix some missing source references for generated nodes



commit c2464222b44b05fcacd7fba4548764309a6d5788
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jun 22 07:13:24 2010 +0200

    Fix some missing source references for generated nodes

 vala/valabinaryexpression.vala |    4 ++--
 vala/valaforeachstatement.vala |    2 +-
 vala/valaparser.vala           |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index 52cd4d9..6e4bbac 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -263,7 +263,7 @@ public class Vala.BinaryExpression : Expression {
 			// string concatenation
 
 			if (analyzer.context.profile == Profile.DOVA) {
-				var concat_call = new MethodCall (new MemberAccess (left, "concat"));
+				var concat_call = new MethodCall (new MemberAccess (left, "concat", source_reference), source_reference);
 				concat_call.add_argument (right);
 				concat_call.target_type = target_type;
 				parent_node.replace_expression (this, concat_call);
@@ -286,7 +286,7 @@ public class Vala.BinaryExpression : Expression {
 		    && operator == BinaryOperator.PLUS) {
 			// list concatenation
 
-			var concat_call = new MethodCall (new MemberAccess (left, "concat"));
+			var concat_call = new MethodCall (new MemberAccess (left, "concat", source_reference), source_reference);
 			concat_call.add_argument (right);
 			concat_call.target_type = target_type;
 			parent_node.replace_expression (this, concat_call);
diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala
index 0de1cb8..07a38db 100644
--- a/vala/valaforeachstatement.vala
+++ b/vala/valaforeachstatement.vala
@@ -210,7 +210,7 @@ public class Vala.ForeachStatement : Block {
 			return false;
 		}
 
-		var iterator_call = new MethodCall (new MemberAccess (collection, "iterator"));
+		var iterator_call = new MethodCall (new MemberAccess (collection, "iterator", source_reference), source_reference);
 		add_statement (new DeclarationStatement (new LocalVariable (iterator_type, "_%s_it".printf (variable_name), iterator_call, source_reference), source_reference));
 
 		var next_value_method = iterator_type.get_member ("next_value") as Method;
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index c80b4e0..1183142 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -1486,9 +1486,9 @@ public class Vala.Parser : CodeVisitor {
 						//     return;
 						var ret_stmt = (ReturnStatement) stmt;
 						if (ret_stmt.return_expression != null) {
-							var assignment = new Assignment (new MemberAccess.simple ("result"), ret_stmt.return_expression);
+							var assignment = new Assignment (new MemberAccess.simple ("result", stmt.source_reference), ret_stmt.return_expression, AssignmentOperator.SIMPLE, stmt.source_reference);
 							ret_stmt.return_expression = null;
-							block.add_statement (new ExpressionStatement (assignment));
+							block.add_statement (new ExpressionStatement (assignment, stmt.source_reference));
 						}
 					}
 					block.add_statement (stmt);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]