]> gitweb.factorcode.org Git - factor.git/commitdiff
see: ERROR: should print as ERROR:.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 13 Aug 2015 23:12:17 +0000 (16:12 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 13 Aug 2015 23:12:46 +0000 (16:12 -0700)
basis/see/see-tests.factor
basis/see/see.factor

index 3e5366dde112e87cf219e71f4bad286c638cc0d7..103e8a6edbe2a1a32c40a4b0ab7d82415c7f1545 100644 (file)
@@ -1,4 +1,5 @@
-USING: see tools.test io.streams.string math summary words ;
+USING: see tools.test io.streams.string math sequences summary
+words ;
 IN: see.tests
 
 CONSTANT: test-const 10
@@ -6,6 +7,9 @@ CONSTANT: test-const 10
 { "IN: see.tests\nCONSTANT: test-const 10 inline\n" }
 [ [ \ test-const see ] with-string-writer ] unit-test
 
+{ "IN: sequences\nERROR: non-negative-integer-expected n ;\n" }
+[ [ \ non-negative-integer-expected see ] with-string-writer ] unit-test
+
 ALIAS: test-alias +
 
 { "USING: math ;\nIN: see.tests\nALIAS: test-alias + inline\n" }
@@ -15,3 +19,4 @@ ALIAS: test-alias +
 [ \ test-alias summary ] unit-test
 
 { } [ gensym see ] unit-test
+
index 11105682857427db46f80ad9ea8d2dc1e6faec89..1b006b1ff26760d1be2fc3c96e303e59f0d4eede 100644 (file)
@@ -1,13 +1,14 @@
 ! Copyright (C) 2009, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs classes classes.builtin
-classes.intersection classes.mixin classes.predicate classes.singleton
-classes.tuple classes.union combinators definitions effects generic
-generic.single generic.standard generic.hook io io.pathnames
+classes.error classes.intersection classes.mixin
+classes.predicate classes.singleton classes.tuple classes.union
+combinators definitions effects generic generic.hook
+generic.single generic.standard io io.pathnames
 io.streams.string io.styles kernel make namespaces prettyprint
 prettyprint.backend prettyprint.config prettyprint.custom
-prettyprint.sections sequences sets slots sorting strings summary
-words words.symbol words.constant words.alias vocabs ;
+prettyprint.sections sequences sets slots sorting strings
+summary vocabs words words.alias words.constant words.symbol ;
 IN: see
 
 GENERIC: synopsis* ( defspec -- )
@@ -236,6 +237,18 @@ M: word see*
         [ drop ] [ call-next-method ] if
     ] tri ;
 
+M: error-class see-class*
+    <colon \ ERROR: pprint-word
+    {
+        [ pprint-word ]
+        [ superclass. ]
+        [ <block "slots" word-prop [ name>> pprint-slot-name ] each block> pprint-; ]
+        [ tuple-declarations. ]
+    } cleave
+    block> ;
+
+M: error-class see* see-class ;
+
 : seeing-implementors ( class -- seq )
     dup implementors
     [ [ reader? ] [ writer? ] bi or ] reject