]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Set source_reference of blocks, patch by Abderrahim Kitouni, fixes bug
authorJürg Billeter <j@bitron.ch>
Mon, 4 Aug 2008 20:09:19 +0000 (20:09 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 4 Aug 2008 20:09:19 +0000 (20:09 +0000)
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

svn path=/trunk/; revision=1733

ChangeLog
vala/valablock.vala
vala/valagenieparser.vala
vala/valaparser.vala
vala/valasemanticanalyzer.vala

index 166e54d8e7cfcfe34f1bd52a15d8b452e036dc2c..d319d2d1601e558d8827364765ea071f48f0d13e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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
+
 2008-08-04  Jürg Billeter  <j@bitron.ch>
 
        * vala/valatypesymbol.vala:
index 839a86d363a96a0b16ca7874138ad8e7a09b57ce..4d333b5ca260819d06331c22ffc7fa87c301cbce 100644 (file)
@@ -41,7 +41,7 @@ public class Vala.Block : Symbol, Statement {
         *
         * @param source reference to source code
         */
-       public Block (SourceReference? source_reference = null) {
+       public Block (SourceReference source_reference) {
                this.source_reference = source_reference;
        }
        
index 190b630f5ac8d3345546bfbbd1cb3d1c9dcc3bbd..1c35b48319e9047478ff67737dbd2e63debf88d7 100644 (file)
@@ -1651,7 +1651,7 @@ public class Vala.Genie.Parser : CodeVisitor {
 
                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
index 68b785d53d7c9885307e8ab69f92fefb39c7fcfd..0bdff49679f8bfbfcfe97ec71f6ebc229b9a1e9c 100644 (file)
@@ -1301,7 +1301,7 @@ public class Vala.Parser : CodeVisitor {
 
                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 @@ public class Vala.Parser : CodeVisitor {
                        }
                }
 
+               block.source_reference.last_line = get_current_src ().last_line;
+               block.source_reference.last_column = get_current_src ().last_column;
+
                return block;
        }
 
index 16cf2ec47aa1c8e79727060f7feb4c7e044d1fee..750133caf7e2b72cc3ffd98628c9dea54c4b2a58 100644 (file)
@@ -710,7 +710,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                                        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 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                }
 
                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) {