]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Add SourceLocation.to_string()
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 10 Apr 2019 07:23:54 +0000 (09:23 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 11 Apr 2020 13:03:56 +0000 (15:03 +0200)
vala/valasourcelocation.vala

index 374a6837f74efcdb049ac14cf4a9c2a13a7c28ba..f99361d85aa1b712966e445a9a9a083ed15a1d9b 100644 (file)
@@ -35,5 +35,14 @@ public struct Vala.SourceLocation {
                line = _line;
                column = _column;
        }
+
+       /**
+        * Returns a string representation of this source location.
+        *
+        * @return human-readable string
+        */
+       public string to_string () {
+               return ("%d.%d".printf (line, column));
+       }
 }