Better handling of errors without file/line info

db4
Slava Pestov 2009-04-13 17:19:32 -05:00
parent 2fc05aa44c
commit fd5ab25a09
5 changed files with 21 additions and 13 deletions

View File

@ -82,7 +82,7 @@ M: object error-line
error get (:edit) ;
: edit-error ( error -- )
[ file>> ] [ line#>> ] bi edit-location ;
[ file>> ] [ line#>> ] bi 2dup and [ edit-location ] [ 2drop ] if ;
: edit-each ( seq -- )
[

View File

@ -92,7 +92,7 @@ M: object add-breakpoint ;
: (step-into-call-next-method) ( method -- )
next-method-quot (step-into-quot) ;
{
<< {
(step-into-quot)
(step-into-dip)
(step-into-2dip)
@ -102,7 +102,7 @@ M: object add-breakpoint ;
(step-into-execute)
(step-into-continuation)
(step-into-call-next-method)
} [ t "no-compile" set-word-prop ] each
} [ t "no-compile" set-word-prop ] each >>
! Messages sent to walker thread
SYMBOL: step

View File

@ -37,14 +37,17 @@ error-toggle source-file-table error-table error-display ;
SINGLETON: source-file-renderer
M: source-file-renderer row-columns
drop first2
[ [ source-file-icon ] [ ] [ length number>string ] tri* ] output>array ;
drop first2 [
[ source-file-icon ]
[ "<Listener input>" or ]
[ length number>string ] tri*
] output>array ;
M: source-file-renderer prototype-row
drop source-file-icon "" "" 3array ;
M: source-file-renderer row-value
drop dup [ first <pathname> ] when ;
drop dup [ first [ <pathname> ] [ f ] if* ] when ;
M: source-file-renderer column-titles
drop { "" "File" "Errors" } ;
@ -76,7 +79,7 @@ M: error-renderer row-columns
drop [
{
[ error-type error-icon ]
[ line#>> number>string ]
[ line#>> [ number>string ] [ "" ] if* ]
[ asset>> unparse-short ]
[ error>> summary ]
} cleave
@ -96,9 +99,12 @@ M: error-renderer column-alignment drop { 0 1 0 0 } ;
: sort-errors ( seq -- seq' )
[ [ [ file>> ] [ line#>> ] bi 2array ] compare ] sort ;
: file-matches? ( error pathname/f -- ? )
[ file>> ] [ dup [ string>> ] when ] bi* = ;
: <error-table-model> ( error-list -- model )
[ model>> ] [ source-file>> ] bi
[ [ file>> ] [ string>> ] bi* = ] <search>
[ file-matches? ] <search>
[ sort-errors ] <arrow> ;
:: <error-table> ( error-list -- table )

View File

@ -82,6 +82,8 @@ M: engine-word stack-effect
effect boa
] [ 2drop f ] if ;
M: engine-word where "tuple-dispatch-generic" word-prop where ;
M: engine-word crossref? "forgotten" word-prop not ;
M: engine-word irrelevant? drop t ;

View File

@ -20,10 +20,7 @@ GENERIC: error-type ( error -- type )
new
swap
[ >>asset ]
[
where [ first2 ] [ "<unknown file>" 0 ] if*
[ >>file ] [ >>line# ] bi*
] bi
[ where [ first2 [ >>file ] [ >>line# ] bi* ] when* ] bi
swap >>error ; inline
: delete-file-errors ( seq file type -- )
@ -42,8 +39,11 @@ error-types [ V{ } clone ] initialize
: error-icon-path ( type -- icon )
error-types get at icon>> ;
: error-counts ( -- alist )
error-types get [ nip dup quot>> call( -- seq ) length ] assoc-map ;
: error-summary ( -- )
error-types get [ nip dup quot>> call( -- seq ) length ] assoc-map
error-counts
[ nip 0 > ] assoc-filter
[
over