]> gitweb.factorcode.org Git - factor.git/blob - core/compiler/errors/errors-docs.factor
Merge branch 'master' into experimental
[factor.git] / core / compiler / errors / errors-docs.factor
1 IN: compiler.errors
2 USING: help.markup help.syntax vocabs.loader words io
3 quotations words.symbol ;
4
5 ARTICLE: "compiler-errors" "Compiler warnings and errors"
6 "The compiler saves " { $link "inference-errors" } " in a global variable:"
7 { $subsection compiler-errors }
8 "These notifications can be viewed later:"
9 { $subsection :errors }
10 { $subsection :warnings }
11 { $subsection :linkage }
12 "Words such as " { $link require } " use a combinator which counts errors and prints a report at the end:"
13 { $subsection with-compiler-errors } ;
14
15 HELP: compiler-errors
16 { $var-description "Global variable holding an assoc mapping words to compiler errors. This variable is set by " { $link with-compiler-errors } "." } ;
17
18 ABOUT: "compiler-errors"
19
20 HELP: compiler-error
21 { $values { "error" "an error" } { "word" word } }
22 { $description "If inside a " { $link with-compiler-errors } ", saves the error for future persual via " { $link :errors } ", " { $link :warnings } " and " { $link :linkage } ". If not inside a " { $link with-compiler-errors } ", ignores the error." } ;
23
24 HELP: compiler-error.
25 { $values { "error" "an error" } { "word" word } }
26 { $description "Prints a compiler error to " { $link output-stream } "." } ;
27
28 HELP: compiler-errors.
29 { $values { "type" symbol } }
30 { $description "Prints compiler errors to " { $link output-stream } ". The type parameter is one of " { $link +error+ } ", " { $link +warning+ } ", or " { $link +linkage+ } "." } ;
31 HELP: :errors
32 { $description "Prints all serious compiler errors from the most recent compile to " { $link output-stream } "." } ;
33
34 HELP: :warnings
35 { $description "Prints all ignorable compiler warnings from the most recent compile to " { $link output-stream } "." } ;
36
37 HELP: :linkage
38 { $description "Prints all C library interface linkage errors from the most recent compile to " { $link output-stream } "." } ;
39
40 { :errors :warnings } related-words
41
42 HELP: with-compiler-errors
43 { $values { "quot" quotation } }
44 { $description "Calls the quotation and collects any compiler warnings and errors. Compiler warnings and errors are summarized at the end and can be viewed with " { $link :errors } ", " { $link :warnings } ", and " { $link :linkage } "." }
45 { $notes "Nested calls to " { $link with-compiler-errors } " are ignored, and only the outermost call collects warnings and errors." } ;