]> gitweb.factorcode.org Git - factor.git/commitdiff
help.syntax: fix intermediate double spaces.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 15 Dec 2020 04:59:41 +0000 (20:59 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 15 Dec 2020 04:59:41 +0000 (20:59 -0800)
basis/help/syntax/syntax-tests.factor
basis/help/syntax/syntax.factor

index 191fe7321ed9fb7e63dc5dac925f6b9b7f6af5fb..6493d89f2bf39651a15b3ffa4b3e03217f735e30 100644 (file)
@@ -23,6 +23,10 @@ tools.test vocabs ;
     HELP{ $description "test " { $snippet "and" } " that" }
 ] unit-test
 
+{ { $description "test " { $snippet "and" } " that " { $snippet "the other" } "." } } [
+    HELP{ $description "test " { $snippet "and" } " that " { $snippet "the other" } "." }
+] unit-test
+
 { { $description "this and that" } } [
     HELP{ $description this and that }
 ] unit-test
index 20903a1c19fa2cec2de72fff34a44d99549e0794..cbbc66a633833d8baeec50e5c524dcf73f1a25ac 100644 (file)
@@ -22,10 +22,11 @@ IN: help.syntax
     [ [ suffix! ] curry dip ] bi* ;
 
 : push-help-space ( accum sbuf -- accum sbuf )
-    {
-        [ dup empty? not over ?last CHAR: \s eq? not and ]
-        [ over empty? not pick ?last \ $nl eq? not and ]
-    } 0|| [ CHAR: \s suffix! ] when ;
+    dup empty? [
+        over empty? not pick ?last \ $nl eq? not and
+    ] [
+        dup last CHAR: \s eq? not
+    ] if [ CHAR: \s suffix! ] when ;
 
 :: parse-help-text ( -- seq )
     V{ } clone SBUF" " clone [