]> gitweb.factorcode.org Git - factor.git/blob - basis/source-files/errors/debugger/debugger.factor
2e7cfbd50137db7a02031a9e865022be29e562ed
[factor.git] / basis / source-files / errors / debugger / debugger.factor
1 ! (c)2010 Joe Groff bsd license
2 USING: accessors debugger io kernel make math.parser
3 prettyprint source-files.errors summary ;
4 IN: source-files.errors.debugger
5
6 CONSTANT: +listener-input+ "<Listener input>"
7
8 : error-location ( error -- string )
9     [
10         [ path>> [ % ] [ +listener-input+ % ] if* ]
11         [ line#>> [ ": " % # ] when* ] bi
12     ] "" make ;
13
14 M: source-file-error summary error>> summary ;
15
16 M: source-file-error error.
17     [ error-location print nl ]
18     [ asset>> [ "Asset: " write short. nl ] when* ]
19     [ error>> error. ]
20     tri ;