]> gitweb.factorcode.org Git - factor.git/commitdiff
help.syntax: use split-lines for now.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 16 Feb 2022 04:34:55 +0000 (20:34 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 16 Feb 2022 04:35:47 +0000 (20:35 -0800)
Perhaps we remove common blank prefixes instead so that indentation is
still supported.

basis/help/syntax/syntax.factor

index da04d1109a3c6849fd4238df113c71fcd1aed8c3..0c098fc383e85023c34e5587aaf0da6be46d31db 100644 (file)
@@ -81,11 +81,8 @@ DEFER: HELP{
         ] if
     ] produce nip ;
 
-: code-lines ( str -- seq )
-    split-lines [ [ ascii:blank? ] trim ] map harvest ;
-
 : make-example ( str -- seq )
-    code-lines dup { [ array? ] [ length 1 > ] } 1&& [
+    split-lines dup { [ array? ] [ length 1 > ] } 1&& [
         dup length 1 - over [ unescape-string ] change-nth
         \ $example prefix
     ] when ;
@@ -96,7 +93,7 @@ DEFER: HELP{
 
 : parse-help-code ( -- seq )
     \ } parse-until dup { [ length 1 = ] [ first string? ] } 1&&
-    [ first code-lines ] [ >array ] if ;
+    [ first split-lines ] [ >array ] if ;
 
 : help-text? ( word -- ? )
     {