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