]> git.donarmstrong.com Git - lilypond.git/commitdiff
Produces better error messages when one forgets to document a property.
authorMike Solomon <mike@apollinemike.com>
Tue, 26 Jul 2011 09:55:24 +0000 (11:55 +0200)
committerMike Solomon <mike@apollinemike.com>
Tue, 26 Jul 2011 09:56:09 +0000 (11:56 +0200)
Now, error messages are produced if a property's type is not defined.

scm/documentation-lib.scm

index b71709def4f8c79fd9e41bde5257c01b1e632687..af48e55c6b51a32b40a1f1e223e5ef1daf62e2fb 100644 (file)
@@ -179,6 +179,13 @@ 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 +197,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)))