2006-12-07 22:53:50 -05:00
|
|
|
! Copyright (C) 2006 Slava Pestov.
|
2006-05-15 00:03:55 -04:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2006-12-07 22:53:50 -05:00
|
|
|
USING: arrays definitions generic hashtables tools io
|
2006-11-15 22:57:58 -05:00
|
|
|
kernel math namespaces parser prettyprint sequences
|
2006-12-07 22:53:50 -05:00
|
|
|
sequences-internals strings styles vectors words errors help ;
|
2006-11-15 22:57:58 -05:00
|
|
|
IN: errors
|
2006-08-01 17:56:20 -04:00
|
|
|
|
2006-08-25 00:02:30 -04:00
|
|
|
: :edit ( -- )
|
2006-11-30 02:15:42 -05:00
|
|
|
error get delegates [ parse-error? ] find-last nip [
|
2006-11-28 18:44:55 -05:00
|
|
|
dup parse-error-file ?resource-path
|
|
|
|
swap parse-error-line edit-location
|
|
|
|
] when* ;
|
2006-08-25 00:02:30 -04:00
|
|
|
|
2006-08-01 18:14:22 -04:00
|
|
|
: (:help-multi)
|
2006-11-08 22:58:01 -05:00
|
|
|
"This error has multiple delegates:" print
|
|
|
|
help-outliner terpri ;
|
2006-08-01 18:14:22 -04:00
|
|
|
|
|
|
|
: (:help-none)
|
|
|
|
drop "No help for this error. " print ;
|
|
|
|
|
2006-08-01 04:45:05 -04:00
|
|
|
: :help ( -- )
|
|
|
|
error get delegates [ error-help ] map [ ] subset
|
2006-08-01 18:14:22 -04:00
|
|
|
{
|
|
|
|
{ [ dup empty? ] [ (:help-none) ] }
|
|
|
|
{ [ dup length 1 = ] [ first help ] }
|
|
|
|
{ [ t ] [ (:help-multi) ] }
|
|
|
|
} cond ;
|