]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.scaffold: fix scaffold-docs generating $var-decsription for classes
authorAlexander Iljin <ajsoft@yandex.ru>
Sat, 25 Jun 2016 20:13:36 +0000 (23:13 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 29 Jun 2016 21:17:57 +0000 (14:17 -0700)
basis/tools/scaffold/scaffold-tests.factor
basis/tools/scaffold/scaffold.factor

index 17f1f02df12e7d35b990f50a0fb052bba9c8d6e1..ce96a0cab8fc3ded4c0e287e81cd9ac411cea37a 100644 (file)
@@ -20,6 +20,14 @@ IN: tools.scaffold.tests
     [ \ undocumented-word (help.) ] with-string-writer
 ] unit-test
 
+{
+"HELP: iota-tuple
+{ $class-description \"\" } ;
+" }
+[
+    [ \ iota-tuple (help.) ] with-string-writer
+] unit-test
+
 { sequence t } [ "seq" lookup-type ] unit-test
 { sequence t } [ "seq'" lookup-type ] unit-test
 { sequence t } [ "newseq" lookup-type ] unit-test
index 00cf2297b5fd3e88d8137cd30089d9786a4cff38..003c90e14cfcfde3f5ecafcfb1a01d91ff20ed2d 100644 (file)
@@ -185,6 +185,10 @@ M: object add-using ( object -- )
         ] if
     ] when* ;
 
+: class-description. ( word -- )
+    drop
+    "{ $class-description \"\" } ;" print ;
+
 : symbol-description. ( word -- )
     drop
     "{ $var-description \"\" } ;" print ;
@@ -194,11 +198,11 @@ M: object add-using ( object -- )
     "{ $description \"\" } ;" print ;
 
 : docs-body. ( word/symbol -- )
-    dup symbol? [
-        symbol-description.
-    ] [
-        [ $values. ] [ $description. ] bi
-    ] if ;
+    {
+        { [ dup class? ] [ class-description. ] }
+        { [ dup symbol? ] [ symbol-description. ] }
+        [ [ $values. ] [ $description. ] bi ]
+    } cond ;
 
 : docs-header. ( word -- )
     "HELP: " write name>> print ;