[vala] girparser: Fix some source reference when reporting errors after parsing



commit 1c6064c6d49dcb5f682d7b213a47749f0f298817
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Jan 4 13:01:09 2014 +0100

    girparser: Fix some source reference when reporting errors after parsing

 vala/valagirparser.vala |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 4f130ce..8a2fb1b 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -3343,7 +3343,7 @@ public class Vala.GirParser : CodeVisitor {
 
                if (return_type is ArrayType && node.return_array_length_idx >= 0) {
                        if (node.return_array_length_idx >= parameters.size) {
-                               Report.error (get_current_src (), "invalid array length index");
+                               Report.error (return_type.source_reference, "invalid array length index");
                        } else {
                                parameters[node.return_array_length_idx].keep = false;
                                node.array_length_parameters.add (node.return_array_length_idx);
@@ -3458,7 +3458,7 @@ public class Vala.GirParser : CodeVisitor {
 
                        if (info.array_length_idx != -1) {
                                if ((info.array_length_idx) >= parameters.size) {
-                                       Report.error (get_current_src (), "invalid array_length index");
+                                       Report.error (info.param.source_reference, "invalid array_length 
index");
                                        continue;
                                }
                                set_array_ccode (info.param, parameters[info.array_length_idx]);
@@ -3466,7 +3466,7 @@ public class Vala.GirParser : CodeVisitor {
 
                        if (info.closure_idx != -1) {
                                if ((info.closure_idx) >= parameters.size) {
-                                       Report.error (get_current_src (), "invalid closure index");
+                                       Report.error (info.param.source_reference, "invalid closure index");
                                        continue;
                                }
                                if ("%g".printf (parameters[info.closure_idx].vala_idx) != "%g".printf 
(info.vala_idx + 0.1)) {
@@ -3475,7 +3475,7 @@ public class Vala.GirParser : CodeVisitor {
                        }
                        if (info.destroy_idx != -1) {
                                if (info.destroy_idx >= parameters.size) {
-                                       Report.error (get_current_src (), "invalid destroy index");
+                                       Report.error (info.param.source_reference, "invalid destroy index");
                                        continue;
                                }
                                if ("%g".printf (parameters[info.destroy_idx].vala_idx) != "%g".printf 
(info.vala_idx + 0.2)) {


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