From 6d7a8dbae57f06b883bab6e57728d07a9d072c22 Mon Sep 17 00:00:00 2001 From: Ludovic Courtes Date: Sun, 23 Jul 2006 20:49:40 +0000 Subject: Improved error reporting of the Skribilo module reader. * src/guile/skribilo/utils/syntax.scm (%skribilo-module-reader): Improved error reporting by showing the location of the unexpected character. git-archimport-id: lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-23 --- src/guile/skribilo/utils/syntax.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/guile/skribilo/utils/syntax.scm b/src/guile/skribilo/utils/syntax.scm index 975b879..06c89bd 100644 --- a/src/guile/skribilo/utils/syntax.scm +++ b/src/guile/skribilo/utils/syntax.scm @@ -42,8 +42,15 @@ '(colon-keywords no-scsh-block-comments srfi30-block-comments srfi62-sexp-comments) (lambda (chr port read) - (error "unexpected character in Skribilo module" - chr)) + (let ((file (port-filename port)) + (line (port-line port)) + (column (port-column port))) + (error (string-append + (if (string? file) + (format #f "~a:~a:~a: " file line column) + "") + "unexpected character in Skribilo module") + chr))) ;; By default, don't record positions: this yields a nice read ;; performance improvement. -- cgit v1.2.3