]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
parser: Improve source-reference of declaration block for ForStatement
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 10 Apr 2019 12:12:21 +0000 (14:12 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 6 Aug 2019 11:23:23 +0000 (13:23 +0200)
vala/valaparser.vala

index d03fa2fcc10f26a40aeb6398f85d15003891ee7d..acc470fd1533c16c82f1e0a96cfeb3a01bcb6809 100644 (file)
@@ -1978,8 +1978,10 @@ public class Vala.Parser : CodeVisitor {
                                expect (TokenType.SEMICOLON);
                        } else {
                                // variable declaration in initializer
-                               block = new Block (get_src (begin));
+                               var decl_begin = get_location ();
+                               block = new Block (get_src (decl_begin));
                                parse_local_variable_declarations (block);
+                               block.source_reference.end = get_last_src ().end;
                        }
                }
                Expression condition = null;