[vala/wip/ricotz/lsp-rev: 1/2] vala: Use some replacement for an unavailable identifier string



commit e04dc1e2362991942e87e8a5d3290fa011eb385e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Jan 18 20:03:37 2020 +0100

    vala: Use some replacement for an unavailable identifier string

 vala/valaparser.vala | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index e0b8d5018..3486a55ba 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -146,6 +146,11 @@ public class Vala.Parser : CodeVisitor {
                return tokens[index].begin;
        }
 
+       string get_location_string () {
+               var begin = get_location ();
+               return "__VALA_L%d_C%d__".printf (begin.line, begin.column);
+       }
+
        string get_current_string () {
                var token = tokens[index];
                return ((string) token.begin.pos).substring (0, (int) (token.end.pos - token.begin.pos));
@@ -287,7 +292,7 @@ public class Vala.Parser : CodeVisitor {
                        if (context.keep_going) {
                                report_parse_error (e);
                                prev ();
-                               return "";
+                               return get_location_string ();
                        } else {
                                throw e;
                        }


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