]> gitweb.factorcode.org Git - factor.git/commitdiff
english: simplify or-markup-example.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 15 Feb 2018 22:12:42 +0000 (14:12 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 15 Feb 2018 22:12:42 +0000 (14:12 -0800)
basis/english/english-tests.factor
basis/english/english.factor

index c4ee93ce1f0172e2f57981091f814ba2d74f5d5e..999fede063b4f0ca2f8387e58cecbba3265d8a70 100644 (file)
@@ -119,5 +119,12 @@ IN: english
 } } [ { object } or-markup-example ] unit-test
 
 { {
-    { "an " { $link object } } " or " { "a " { $link pair } }
+    { "an " { $link object } } " or "
+    { "a " { $link pair } }
 } } [ { object pair } or-markup-example ] unit-test
+
+{ {
+    { "an " { $link object } } ", "
+    { "a " { $link pair } } ", or "
+    { "a " { $snippet "thing" } }
+} } [ { object pair "thing" } or-markup-example ] unit-test
index 64b72213f25b9ff7bdc9c940c15637181ba89bbd..891edffb32df12f560f1e07d7af5047e1db1b1e1 100644 (file)
@@ -180,10 +180,10 @@ PRIVATE>
 : or-markup-example ( classes -- markup )
     [
         dup word? [
-            [ name>> a/an " " append ] [ \ $link swap 2array ] bi 2array
+            [ name>> ] keep \ $link
         ] [
-            [ "\"" ?head drop a/an ] keep 1array \ $snippet prefix " " swap 3array
-        ] if
+            dup \ $snippet
+        ] if swap 2array [ a/an " " append ] dip 2array
     ] map "or" comma-list ;
 
 : $or-markup-example ( classes -- )