[vala/0.40] parser: Improve source-reference of declaration block for ForStatement



commit deeb579fc20bcfc5ef5a2cd1d5a68afed16aac87
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Apr 10 14:12:21 2019 +0200

    parser: Improve source-reference of declaration block for ForStatement

 vala/valaparser.vala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 35228c48d..47ceb3cdf 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -2008,8 +2008,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;


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