[vala/wip/printer: 2/6] vala: Add SourceLocation.to_string()



commit f512d7aa2a0f79d51ad0cd91e6b2a013077c5740
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Apr 10 09:23:54 2019 +0200

    vala: Add SourceLocation.to_string()

 vala/valasourcelocation.vala | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/vala/valasourcelocation.vala b/vala/valasourcelocation.vala
index 374a6837f..f99361d85 100644
--- a/vala/valasourcelocation.vala
+++ b/vala/valasourcelocation.vala
@@ -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));
+       }
 }
 


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