2009-04-09 05:50:38 -04:00
|
|
|
! Copyright (C) 2009 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2009-04-15 01:27:02 -04:00
|
|
|
USING: assocs debugger io kernel sequences source-files.errors
|
2009-04-18 04:21:31 -04:00
|
|
|
summary accessors continuations make math.parser io.styles namespaces
|
|
|
|
compiler.errors ;
|
2009-04-09 05:50:38 -04:00
|
|
|
IN: tools.errors
|
|
|
|
|
|
|
|
#! Tools for source-files.errors. Used by tools.tests and others
|
|
|
|
#! for error reporting
|
|
|
|
|
2009-04-15 01:27:02 -04:00
|
|
|
M: source-file-error compute-restarts
|
|
|
|
error>> compute-restarts ;
|
|
|
|
|
|
|
|
M: source-file-error error-help
|
|
|
|
error>> error-help ;
|
|
|
|
|
2009-04-17 16:50:11 -04:00
|
|
|
M: source-file-error summary
|
2009-04-15 01:27:02 -04:00
|
|
|
[
|
2009-04-17 16:50:11 -04:00
|
|
|
[ file>> [ % ": " % ] [ "<Listener input>" % ] if* ]
|
|
|
|
[ line#>> [ # ] when* ] bi
|
|
|
|
] "" make
|
|
|
|
;
|
|
|
|
|
|
|
|
M: source-file-error error.
|
|
|
|
[ summary print nl ] [ error>> error. ] bi ;
|
2009-04-15 01:27:02 -04:00
|
|
|
|
2009-04-09 05:50:38 -04:00
|
|
|
: errors. ( errors -- )
|
|
|
|
group-by-source-file sort-errors
|
|
|
|
[
|
|
|
|
[ nl "==== " write print nl ]
|
|
|
|
[ [ nl ] [ error. ] interleave ]
|
|
|
|
bi*
|
|
|
|
] assoc-each ;
|
2009-04-18 04:21:31 -04:00
|
|
|
|
|
|
|
: compiler-errors. ( type -- )
|
|
|
|
errors-of-type values errors. ;
|
|
|
|
|
|
|
|
: :errors ( -- ) +compiler-error+ compiler-errors. ;
|
|
|
|
|
|
|
|
: :warnings ( -- ) +compiler-warning+ compiler-errors. ;
|
|
|
|
|
|
|
|
: :linkage ( -- ) +linkage-error+ compiler-errors. ;
|