diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-04-10 09:23:54 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-04-11 15:03:56 +0200 |
commit | 5cebc0e477287d9759b506a5bc5e37797cb3a156 (patch) | |
tree | 10adc76d6b3f23a397793b3fff46ce7d7f045926 /vala/valasourcelocation.vala | |
parent | 138930033494d77c7cf13c95fd4c370adce4e98d (diff) | |
download | vala-5cebc0e477287d9759b506a5bc5e37797cb3a156.tar.gz |
vala: Add SourceLocation.to_string()
Diffstat (limited to 'vala/valasourcelocation.vala')
-rw-r--r-- | vala/valasourcelocation.vala | 9 |
1 files changed, 9 insertions, 0 deletions
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)); + } } |