rearrange source-file-error error. to load earlier

Fixes #359
db4
Joe Groff 2011-11-15 18:26:17 -08:00
parent 9ae3b50a53
commit 5a66b3b329
3 changed files with 25 additions and 18 deletions

View File

@ -0,0 +1,20 @@
USING: accessors debugger io kernel make math.parser
prettyprint source-files.errors summary ;
IN: source-files.errors.debugger
CONSTANT: +listener-input+ "<Listener input>"
: error-location ( error -- string )
[
[ file>> [ % ] [ +listener-input+ % ] if* ]
[ line#>> [ ": " % # ] when* ] bi
] "" make ;
M: source-file-error summary error>> summary ;
M: source-file-error error.
[ error-location print nl ]
[ asset>> [ "Asset: " write short. nl ] when* ]
[ error>> error. ]
tri ;

View File

@ -2,28 +2,12 @@
! See http://factorcode.org/license.txt for BSD license.
USING: assocs debugger io kernel sequences source-files.errors
summary accessors continuations make math.parser io.styles namespaces
compiler.errors prettyprint ;
compiler.errors prettyprint source-files.errors.debugger ;
IN: tools.errors
#! Tools for source-files.errors. Used by tools.tests and others
#! for error reporting
CONSTANT: +listener-input+ "<Listener input>"
: error-location ( error -- string )
[
[ file>> [ % ] [ +listener-input+ % ] if* ]
[ line#>> [ ": " % # ] when* ] bi
] "" make ;
M: source-file-error summary error>> summary ;
M: source-file-error error.
[ error-location print nl ]
[ asset>> [ "Asset: " write short. nl ] when* ]
[ error>> error. ]
tri ;
: errors. ( errors -- )
group-by-source-file sort-errors
[
@ -40,4 +24,4 @@ M: not-compiled summary
word>> name>> "The word " " cannot be executed because it failed to compile" surround ;
M: not-compiled error.
[ summary print nl ] [ error>> error. ] bi ;
[ summary print nl ] [ error>> error. ] bi ;

View File

@ -168,3 +168,6 @@ PRIVATE>
] require-hook set-global
M: vocab-spec where vocab-source-path dup [ 1 2array ] when ;
! put here to avoid circularity between vocabs.loader and source-files.errors
{ "source-files.errors" "debugger" } "source-files.errors.debugger" require-when