lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Produces better error messages when programmers forget to document a pro


From: mtsolo
Subject: Produces better error messages when programmers forget to document a property. (issue4801045)
Date: Wed, 20 Jul 2011 12:47:56 +0000

Reviewers: ,

Message:
I've needed something like this for a long time - lemme know what you
think!

Cheers,
MS

Description:
Produces better error messages when programmers forget to document a
property.

Please review this at http://codereview.appspot.com/4801045/

Affected files:
  M scm/documentation-lib.scm


Index: scm/documentation-lib.scm
diff --git a/scm/documentation-lib.scm b/scm/documentation-lib.scm
index b71709def4f8c79fd9e41bde5257c01b1e632687..d197d36560f137cac326e56423f94bcd881805fd 100644
--- a/scm/documentation-lib.scm
+++ b/scm/documentation-lib.scm
@@ -179,6 +179,11 @@ string-to-use). If QUOTE? is #t, embed table in a @quotation environment."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; property  stuff.

+(define (verify-type-name where sym type)
+  (if (eq? type #f)
+ (ly:error (_ "cannot find description for property ~S (~S)") sym where))
+  (type-name type))
+
 (define (property->texi where sym . rest)
   "Document SYM for WHERE (which can be translation, backend, music),
 with init values from ALIST (1st optional argument)
@@ -190,7 +195,7 @@ with init values from ALIST (1st optional argument)
         (doc-name (string->symbol
                    (string-append (symbol->string where) "-doc")))
         (type (object-property sym type?-name))
-        (typename (type-name type))
+        (typename (verify-type-name where sym type))
         (desc (object-property sym doc-name))
         (init-value (assoc-get sym alist)))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]