]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3954: Report bad return values in user-readable form
authorDavid Kastrup <dak@gnu.org>
Sun, 15 Jun 2014 12:31:48 +0000 (14:31 +0200)
committerDavid Kastrup <dak@gnu.org>
Fri, 20 Jun 2014 11:43:26 +0000 (13:43 +0200)
An error message like

  markup-def.ly:11:20: error: music function cannot return
  (#<procedure line-markup (layout props args)> (Test))

is not really user-readable.  At the price of some possible ambiguity,
using a LilyPond syntax form like

  markup-def.ly:11:20: error: music function cannot return \markup \line { Test}

is quite preferable.

scm/ly-syntax-constructors.scm

index 2712fc21f3c331228192f563285b8b34fc246777..73e871686e3ee079f488ec646b0d550d870206ba 100644 (file)
@@ -64,7 +64,8 @@
           (if good
               (ly:parser-error parser
                                (format #f (_ "~a function cannot return ~a")
-                                       (type-name pred) m)
+                                       (type-name pred)
+                                       (value->lily-string m parser))
                                loc))
           (and (pair? (car sig)) (cdar sig))))))