From 88a8b55a83b32759c9f842ad12ca05703d62596a Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Tue, 6 Dec 2011 16:09:30 +0100 Subject: [PATCH] Make for better error messages in cases like #{ #) #} --- scm/parser-ly-from-scheme.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scm/parser-ly-from-scheme.scm b/scm/parser-ly-from-scheme.scm index a2bc74c27a..91fbe3675d 100644 --- a/scm/parser-ly-from-scheme.scm +++ b/scm/parser-ly-from-scheme.scm @@ -33,6 +33,7 @@ from @var{port} and return the corresponding Scheme music expression. (write-char x out) x)) #f) "r"))) + (set-port-filename! copycat filename) (do ((c (read-char port) (read-char port))) ((and (char=? c #\#) (char=? (peek-char port) #\})) @@ -42,7 +43,13 @@ from @var{port} and return the corresponding Scheme music expression. ;; a #scheme or $scheme expression (if (or (char=? c #\#) (char=? c #\$)) (let* ((p (ftell out)) - (expr (read copycat))) + (expr + (begin + (set-port-line! copycat + (port-line port)) + (set-port-column! copycat + (port-column port)) + (read copycat)))) ;; kill unused lookahead, it has been ;; written out already (drain-input copycat) -- 2.39.2