From a6926b19ce97cdd8cfd2634fa41c1100bf9dde70 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 13 Aug 2015 16:12:17 -0700 Subject: [PATCH] see: ERROR: should print as ERROR:. --- basis/see/see-tests.factor | 7 ++++++- basis/see/see.factor | 23 ++++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/basis/see/see-tests.factor b/basis/see/see-tests.factor index 3e5366dde1..103e8a6edb 100644 --- a/basis/see/see-tests.factor +++ b/basis/see/see-tests.factor @@ -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 + diff --git a/basis/see/see.factor b/basis/see/see.factor index 1110568285..1b006b1ff2 100644 --- a/basis/see/see.factor +++ b/basis/see/see.factor @@ -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* + > 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