]> gitweb.factorcode.org Git - factor.git/blob - basis/stack-checker/errors/prettyprint/prettyprint.factor
40eca52c6238d091857e08fb93ff431904996a0c
[factor.git] / basis / stack-checker / errors / prettyprint / prettyprint.factor
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
6
7 M: unknown-macro-input summary
8     macro>> name>> "Cannot apply “" "” to an input parameter of a non-inline word" surround ;
9
10 M: bad-macro-input summary
11     macro>> name>> "Cannot apply “" "” to a run-time computed value" surround ;
12
13 M: too-many->r summary
14     drop "Quotation pushes elements on retain stack without popping them" ;
15
16 M: too-many-r> summary
17     drop "Quotation pops retain stack elements which it did not push" ;
18
19 M: missing-effect summary
20     drop "Missing stack effect declaration" ;
21
22 M: effect-error summary
23     drop "Stack effect declaration is wrong" ;
24
25 M: recursive-quotation-error summary
26     drop "Recursive quotation" ;
27
28 M: undeclared-recursion-error summary
29     word>> name>>
30     "The inline recursive word “" "” must be declared recursive" surround ;
31
32 M: diverging-recursion-error summary
33     word>> name>>
34     "The recursive word “" "” digs arbitrarily deep into the stack" surround ;
35
36 M: unbalanced-recursion-error summary
37     word>> name>>
38     "The recursive word “" "” leaves with the stack having the wrong height" surround ;
39
40 M: inconsistent-recursive-call-error summary
41     word>> name>>
42     "The recursive word “"
43     "” calls itself with a different set of quotation parameters than were input" surround ;
44
45 M: transform-expansion-error summary
46     word>> name>> "Macro expansion of “" "” threw an error" surround ;
47
48 M: transform-expansion-error error.
49     [ summary print ]
50     [ nl "The error was:" print error>> error. nl ]
51     [ continuation>> traceback-link. ]
52     tri ;
53
54 M: do-not-compile summary
55     word>> name>> "Cannot compile call to “" "”" surround ;
56
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
61     surround ;
62
63 M: unbalanced-branches-error error.
64     dup summary print
65     [ quots>> ] [ declareds>> ] [ actuals>> ] tri 3array flip
66     { "Input" "Expected" "Got" } prefix simple-table. ;