]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/errors/errors.factor
b0c10285df4e64f332bc0bc81dc6bc38e86b0a89
[factor.git] / basis / tools / errors / errors.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors assocs command-line compiler.errors debugger
4 io kernel namespaces sequences source-files.errors
5 source-files.errors.debugger summary ;
6 IN: tools.errors
7
8 ! Tools for source-files.errors. Used by tools.tests and others
9 ! for error reporting
10
11 : errors. ( errors -- )
12     group-by-source-file sort-errors
13     [
14         [ nl "==== " write +listener-input+ or print nl ]
15         [ [ nl ] [ error. ] interleave ]
16         bi*
17     ] assoc-each ;
18
19 : :errors ( -- ) compiler-errors get values errors. ;
20
21 : :linkage ( -- ) linkage-errors get values errors. ;
22
23 : :user-init-errors ( -- )
24     user-init-errors get-global values errors. ;
25
26 M: not-compiled summary
27     word>> name>> "The word " " cannot be executed because it failed to compile" surround ;
28
29 M: not-compiled error.
30     [ summary print nl ] [ error>> error. ] bi ;