]> gitweb.factorcode.org Git - factor.git/commitdiff
help.syntax: fix for help blocks
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 18 Aug 2023 04:20:28 +0000 (21:20 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 18 Aug 2023 04:20:28 +0000 (21:20 -0700)
basis/help/syntax/syntax.factor

index af81760f71dd40ac2b62afd729b388dbd5667b29..e4bbdcc6279e3547c80e6981fc585d613136f535 100644 (file)
@@ -34,10 +34,20 @@ DEFER: HELP{
     [ dup empty? [ >string suffix! SBUF" " clone ] unless ]
     [ [ suffix! ] curry dip ] bi* ;
 
+: help-block? ( word -- ? )
+    {
+        $description $heading $subheading $syntax
+        $class-description $error-description $var-description
+        $contract $notes $curious $deprecated $errors
+        $side-effects $content $warning $subsections $nl
+        $list $table $example $unchecked-example $code
+    } member-eq? ;
+
 : ?push-help-space ( accum sbuf obj -- accum sbuf' obj )
     over empty? [
         pick [ f ] [
-            last [ string? not ] [ \ $nl = not ] bi and
+            last dup array? [ ?first ] when help-block? not
         ] if-empty
     ] [
         over last " (" member? not