]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/errors/errors-docs.factor
Solution to Project Euler problem 65
[factor.git] / basis / tools / errors / errors-docs.factor
1 IN: tools.errors
2 USING: help.markup help.syntax source-files.errors words io
3 compiler.errors classes ;
4
5 ARTICLE: "compiler-errors" "Compiler errors"
6 "After loading a vocabulary, you might see a message like:"
7 { $code
8     ":errors - print 2 compiler errors"
9 }
10 "This indicates that some words did not pass the stack checker. Stack checker error conditions are documented in " { $link "inference-errors" } ", and the stack checker itself in " { $link "inference" } "."
11 $nl
12 "Words to view errors:"
13 { $subsection :errors }
14 { $subsection :linkage }
15 "Compiler errors are reported using the " { $link "tools.errors" } " mechanism, and as a result, they are also are shown in the " { $link "ui.tools.error-list" } "." ;
16
17 HELP: compiler-error
18 { $values { "error" compiler-error } }
19 { $description "Saves the error for viewing with " { $link :errors } "." } ;
20
21 HELP: linkage-error
22 { $values { "error" linkage-error } { "word" word } { "class" class } }
23 { $description "Saves the error for viewing with " { $link :linkage } "." } ;
24
25 HELP: :errors
26 { $description "Prints all compiler errors." } ;
27
28 HELP: :linkage
29 { $description "Prints all C library interface linkage errors." } ;
30
31 { :errors :linkage } related-words
32
33 HELP: errors.
34 { $values { "errors" "a sequence of " { $link source-file-error } " instances" } }
35 { $description "Prints a list of errors, grouped by source file." } ;
36
37 ARTICLE: "tools.errors" "Batch error reporting"
38 "Some tools, such as the " { $link "compiler" } ", " { $link "tools.test" } " and " { $link "help.lint" } " need to report multiple errors at a time. Each error is associated with a source file, line number, and optionally, a definition. " { $link "errors" } " cannot be used for this purpose, so the " { $vocab-link "source-files.errors" } " vocabulary provides an alternative mechanism. Note that the words in this vocabulary are used for implementation only; to actually list errors, consult the documentation for the relevant tools."
39 $nl
40 "Source file errors inherit from a class:"
41 { $subsection source-file-error }
42 "Printing an error summary:"
43 { $subsection error-summary }
44 "Printing a list of errors:"
45 { $subsection errors. }
46 "Batch errors are reported in the " { $link "ui.tools.error-list" } "." ;
47
48 ABOUT: "tools.errors"