[vala/0.48] vala: Add SourceLocation.to_string()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.48] vala: Add SourceLocation.to_string()
- Date: Mon, 20 Apr 2020 17:42:55 +0000 (UTC)
commit cbca6e76d40b6b22dda5cf63c0273a3568cef8dc
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]