summaryrefslogtreecommitdiff
path: root/src/guile/skribilo/location.scm
diff options
context:
space:
mode:
Diffstat (limited to 'src/guile/skribilo/location.scm')
-rw-r--r--src/guile/skribilo/location.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/guile/skribilo/location.scm b/src/guile/skribilo/location.scm
index 2f9e627..fa88b18 100644
--- a/src/guile/skribilo/location.scm
+++ b/src/guile/skribilo/location.scm
@@ -1,7 +1,7 @@
;;; location.scm -- Skribilo source location.
;;; -*- coding: iso-8859-1 -*-
;;;
-;;; Copyright 2005, 2007, 2009, 2010, 2012 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright 2005, 2007, 2009, 2010, 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;; Copyright 2003, 2004 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;
;;;
@@ -27,7 +27,8 @@
:export (<location> location? ast-location
location-file location-line location-column
invocation-location
- source-properties->location))
+ source-properties->location
+ location->string))
;;; Author: Ludovic Courtès
;;;
@@ -113,4 +114,11 @@ etc."
:line (and line (+ line 1))
:column (and col (+ col 1))))))
+(define (location->string loc)
+ "Return a user-friendly representation of LOC."
+ (if (location? loc)
+ (format #f "~a:~a:~a:" (location-file loc) (location-line loc)
+ (location-column loc))
+ "<unknown-location>:"))
+
;;; location.scm ends here.