From 5cebc0e477287d9759b506a5bc5e37797cb3a156 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Wed, 10 Apr 2019 09:23:54 +0200 Subject: [PATCH] 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)); + } } -- 2.47.2