vala r1733 - in trunk: . vala



Author: juergbi
Date: Mon Aug  4 20:09:19 2008
New Revision: 1733
URL: http://svn.gnome.org/viewvc/vala?rev=1733&view=rev

Log:
2008-08-04  JÃrg Billeter  <j bitron ch>

	* vala/valablock.vala:
	* vala/valagenieparser.vala:
	* vala/valaparser.vala:
	* vala/valasemanticanalyzer.vala:

	Set source_reference of blocks, patch by Abderrahim Kitouni,
	fixes bug 546249


Modified:
   trunk/ChangeLog
   trunk/vala/valablock.vala
   trunk/vala/valagenieparser.vala
   trunk/vala/valaparser.vala
   trunk/vala/valasemanticanalyzer.vala

Modified: trunk/vala/valablock.vala
==============================================================================
--- trunk/vala/valablock.vala	(original)
+++ trunk/vala/valablock.vala	Mon Aug  4 20:09:19 2008
@@ -41,7 +41,7 @@
 	 *
 	 * @param source reference to source code
 	 */
-	public Block (SourceReference? source_reference = null) {
+	public Block (SourceReference source_reference) {
 		this.source_reference = source_reference;
 	}
 	

Modified: trunk/vala/valagenieparser.vala
==============================================================================
--- trunk/vala/valagenieparser.vala	(original)
+++ trunk/vala/valagenieparser.vala	Mon Aug  4 20:09:19 2008
@@ -1651,7 +1651,7 @@
 
 		comment = scanner.pop_comment ();
 
-		var block = new Block ();
+		var block = new Block (get_src_com (get_location ()));
 		var stmt = parse_embedded_statement_without_block ();
 		if (stmt == null) {
 			// workaround for current limitation of exception handling

Modified: trunk/vala/valaparser.vala
==============================================================================
--- trunk/vala/valaparser.vala	(original)
+++ trunk/vala/valaparser.vala	Mon Aug  4 20:09:19 2008
@@ -1301,7 +1301,7 @@
 
 		comment = scanner.pop_comment ();
 
-		var block = new Block ();
+		var block = new Block (get_src_com (get_location ()));
 		var stmt = parse_embedded_statement_without_block ();
 		if (stmt == null) {
 			// workaround for current limitation of exception handling
@@ -1345,6 +1345,9 @@
 			}
 		}
 
+		block.source_reference.last_line = get_current_src ().last_line;
+		block.source_reference.last_column = get_current_src ().last_column;
+
 		return block;
 	}
 

Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala	(original)
+++ trunk/vala/valasemanticanalyzer.vala	Mon Aug  4 20:09:19 2008
@@ -710,7 +710,7 @@
 					return;
 				}
 				acc.automatic_body = true;
-				acc.body = new Block ();
+				acc.body = new Block (acc.source_reference);
 				var ma = new MemberAccess.simple ("_%s".printf (acc.prop.name), acc.source_reference);
 				if (acc.readable) {
 					acc.body.add_statement (new ReturnStatement (ma, acc.source_reference));
@@ -3375,7 +3375,7 @@
 		}
 
 		if (l.expression_body != null) {
-			var block = new Block ();
+			var block = new Block (l.source_reference);
 			block.scope.parent_scope = l.method.scope;
 
 			if (l.method.return_type.data_type != null) {



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