]> gitweb.factorcode.org Git - factor.git/commitdiff
Revert "help.lint.coverage: change $values to $inputs and $outputs."
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 May 2020 17:47:27 +0000 (10:47 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 May 2020 17:47:27 +0000 (10:47 -0700)
This reverts commit 61102548f4eec732cf66bb18fc12a81ceadd6ffc.

extra/help/lint/coverage/coverage-tests.factor
extra/help/lint/coverage/coverage.factor

index 0dfa2fdafe08e64b14cf6392a1e60992eab0fe13..1996931e488bccfc7d8defb37544a1c08432999d 100644 (file)
@@ -19,8 +19,8 @@ PRIVATE>
 { f } [ \ a-defined-word empty-examples? ] unit-test
 { f } [ \ keep empty-examples? ] unit-test
 
-{ { $description $inputs $outputs } } [ \ an-empty-word-with-a-unique-name missing-sections natural-sort ] unit-test
-{ { $description $inputs $outputs } } [ \ a-defined-word missing-sections natural-sort ] unit-test
+{ { $description $values } } [ \ an-empty-word-with-a-unique-name missing-sections natural-sort ] unit-test
+{ { $description $values } } [ \ a-defined-word missing-sections natural-sort ] unit-test
 { { } } [ \ keep missing-sections ] unit-test
 
 { { "a.b" "a.b.c" } } [ { "a.b" "a.b.private" "a.b.c.private" "a.b.c" } filter-private ] unit-test
@@ -32,8 +32,8 @@ PRIVATE>
 { { $examples } } [ \ an-empty-word-with-a-unique-name word-defines-sections ] unit-test
 { { $examples } } [ \ a-defined-word word-defines-sections ] unit-test
 { { } } [ \ a-nonexistent-word word-defines-sections ] unit-test
-{ { $inputs $outputs $description $examples } } [ \ keep word-defines-sections ] unit-test
-{ { $inputs $outputs $contract $examples } } [ \ <word-help-coverage> word-defines-sections ] unit-test
+{ { $values $description $examples } } [ \ keep word-defines-sections ] unit-test
+{ { $values $contract $examples } } [ \ <word-help-coverage> word-defines-sections ] unit-test
 
 { an-empty-word-with-a-unique-name } [ "an-empty-word-with-a-unique-name" find-word ] unit-test
 
index 9f722a5c1dd720faa27407a5bab1755cc9c549f0..27c5641d7c3d135381a07cc4259a395c62716751 100644 (file)
@@ -95,15 +95,13 @@ M: word-help-coverage summary
 : filter-private ( seq -- no-private )
     [ ".private" ?tail nip ] reject ; inline
 
-: ?remove-$inputs ( word spec -- word spec )
-    over "declared-effect" word-prop [
-        in>> empty? [ \ $inputs swap remove ] when
-    ] when* ;
-
-: ?remove-$outputs ( word spec -- word spec )
-    over "declared-effect" word-prop [
-        out>> empty? [ \ $outputs swap remove ] when
-    ] when* ;
+: ?remove-$values ( word spec -- spec )
+    \ $values over member? [
+        swap "declared-effect" word-prop [
+            [ in>> ] [ out>> ] bi append [
+                \ $values swap remove
+            ] [ drop ] if-empty
+    ] when* ] [ nip ] if ;
 
 : should-define ( word -- spec )
     dup {
@@ -112,12 +110,12 @@ M: word-help-coverage summary
         { [ dup primitive? ]   [ drop { $description } ] }
         ! aliases should describe why they exist but ideally $values should be
         ! automatically inherited from the aliased word's docs
-        { [ dup alias? ]       [ drop { $inputs $outputs $description } ] }
-        { [ dup error-class? ] [ drop { $inputs $outputs $description $error-description } ] }
+        { [ dup alias? ]       [ drop { $values $description } ] }
+        { [ dup error-class? ] [ drop { $values $description $error-description } ] }
         { [ dup class? ]       [ drop { $class-description } ] }
-        { [ dup generic? ]     [ drop { $inputs $outputs $contract $examples } ] }
-        { [ dup word? ]        [ drop { $inputs $outputs $description $examples } ] }
-    } cond ?remove-$inputs ?remove-$outputs nip ;
+        { [ dup generic? ]     [ drop { $values $contract $examples } ] }
+        { [ dup word? ]        [ drop { $values $description $examples } ] }
+    } cond ?remove-$values ;
 
 : word-defines-sections ( word -- seq )
     word-help [ ignored-words member? not ] filter [ ?first ] map ;