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

index 3e90fb113dd22436442052eb58b32afd1964acd1..190725a85c744a7f6511fcda5d006873d9407faa 100644 (file)
@@ -1996,8 +1996,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;