1 ! Copyright (C) 2008, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays debugger io kernel prettyprint sequences
4 stack-checker.errors summary ;
5 IN: stack-checker.errors.prettyprint
7 M: unknown-macro-input summary
8 macro>> name>> "Cannot apply “" "” to an input parameter of a non-inline word" surround ;
10 M: bad-macro-input summary
11 macro>> name>> "Cannot apply “" "” to a run-time computed value" surround ;
13 M: too-many->r summary
14 drop "Quotation pushes elements on retain stack without popping them" ;
16 M: too-many-r> summary
17 drop "Quotation pops retain stack elements which it did not push" ;
19 M: missing-effect summary
20 drop "Missing stack effect declaration" ;
22 M: effect-error summary
23 drop "Stack effect declaration is wrong" ;
25 M: recursive-quotation-error summary
26 drop "Recursive quotation" ;
28 M: undeclared-recursion-error summary
30 "The inline recursive word “" "” must be declared recursive" surround ;
32 M: diverging-recursion-error summary
34 "The recursive word “" "” digs arbitrarily deep into the stack" surround ;
36 M: unbalanced-recursion-error summary
38 "The recursive word “" "” leaves with the stack having the wrong height" surround ;
40 M: inconsistent-recursive-call-error summary
42 "The recursive word “"
43 "” calls itself with a different set of quotation parameters than were input" surround ;
45 M: transform-expansion-error summary
46 word>> name>> "Macro expansion of “" "” threw an error" surround ;
48 M: transform-expansion-error error.
50 [ nl "The error was:" print error>> error. nl ]
51 [ continuation>> traceback-link. ]
54 M: do-not-compile summary
55 word>> name>> "Cannot compile call to “" "”" surround ;
57 M: unbalanced-branches-error summary
58 [ word>> name>> ] [ quots>> length 1 = ] bi
59 [ "The input quotation to “" "” doesn't match its expected effect" ]
60 [ "The input quotations to “" "” don't match their expected effects" ] if
63 M: unbalanced-branches-error error.
65 [ quots>> ] [ declareds>> ] [ actuals>> ] tri 3array flip
66 { "Input" "Expected" "Got" } prefix simple-table. ;