tools.errors: fix printing of errors with no associated source file
parent
91cd13d2d6
commit
cd91b2e755
|
@ -0,0 +1,20 @@
|
|||
USING: compiler.errors stack-checker.errors tools.test words ;
|
||||
IN: tools.errors
|
||||
|
||||
DEFER: blah
|
||||
|
||||
[ ] [
|
||||
{
|
||||
T{ compiler-error
|
||||
{ error
|
||||
T{ inference-error
|
||||
f
|
||||
T{ do-not-compile f blah }
|
||||
+compiler-error+
|
||||
blah
|
||||
}
|
||||
}
|
||||
{ asset blah }
|
||||
}
|
||||
} errors.
|
||||
] unit-test
|
|
@ -14,9 +14,11 @@ M: source-file-error compute-restarts
|
|||
M: source-file-error error-help
|
||||
error>> error-help ;
|
||||
|
||||
CONSTANT: +listener-input+ "<Listener input>"
|
||||
|
||||
M: source-file-error summary
|
||||
[
|
||||
[ file>> [ % ": " % ] [ "<Listener input>" % ] if* ]
|
||||
[ file>> [ % ": " % ] [ +listener-input+ % ] if* ]
|
||||
[ line#>> [ # ] when* ] bi
|
||||
] "" make
|
||||
;
|
||||
|
@ -27,7 +29,7 @@ M: source-file-error error.
|
|||
: errors. ( errors -- )
|
||||
group-by-source-file sort-errors
|
||||
[
|
||||
[ nl "==== " write print nl ]
|
||||
[ nl "==== " write +listener-input+ or print nl ]
|
||||
[ [ nl ] [ error. ] interleave ]
|
||||
bi*
|
||||
] assoc-each ;
|
||||
|
|
|
@ -4,14 +4,14 @@ USING: accessors arrays sequences sorting assocs colors.constants fry
|
|||
combinators combinators.smart combinators.short-circuit editors make
|
||||
memoize compiler.units fonts kernel io.pathnames prettyprint
|
||||
source-files.errors math.parser init math.order models models.arrow
|
||||
models.arrow.smart models.search models.mapping models.delay debugger namespaces
|
||||
summary locals ui ui.commands ui.gadgets ui.gadgets.panes
|
||||
models.arrow.smart models.search models.mapping models.delay debugger
|
||||
namespaces summary locals ui ui.commands ui.gadgets ui.gadgets.panes
|
||||
ui.gadgets.tables ui.gadgets.labeled ui.gadgets.tracks ui.gestures
|
||||
ui.operations ui.tools.browser ui.tools.common ui.gadgets.scrollers
|
||||
ui.tools.inspector ui.gadgets.status-bar ui.operations
|
||||
ui.gadgets.buttons ui.gadgets.borders ui.gadgets.packs
|
||||
ui.gadgets.labels ui.baseline-alignment ui.images
|
||||
compiler.errors calendar ;
|
||||
ui.gadgets.labels ui.baseline-alignment ui.images ui.tools.listener
|
||||
compiler.errors calendar tools.errors ;
|
||||
IN: ui.tools.error-list
|
||||
|
||||
CONSTANT: source-file-icon
|
||||
|
@ -39,7 +39,7 @@ SINGLETON: source-file-renderer
|
|||
M: source-file-renderer row-columns
|
||||
drop first2 [
|
||||
[ source-file-icon ]
|
||||
[ "<Listener input>" or ]
|
||||
[ +listener-input+ or ]
|
||||
[ length number>string ] tri*
|
||||
] output>array ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue