]> gitweb.factorcode.org Git - factor.git/blob - core/source-files/source-files-docs.factor
Support multiline entries in the UI Listener
[factor.git] / core / source-files / source-files-docs.factor
1 USING: help.markup help.syntax vocabs.loader io.pathnames
2 quotations compiler.units ;
3 IN: source-files
4
5 ARTICLE: "source-files" "Source files"
6 "Words in the " { $vocab-link "source-files" } " vocabulary are used to keep track of loaded source files. This is used to implement " { $link "vocabs.refresh" } "."
7 $nl
8 "The source file database:"
9 { $subsections source-files }
10 "The class of source files:"
11 { $subsections source-file }
12 "Words intended for the parser:"
13 { $subsections
14     record-checksum
15     record-definitions
16 }
17 "Removing a source file from the database:"
18 { $subsections forget-source }
19 "Updating the database:"
20 { $subsections reset-checksums }
21 "The " { $link pathname } " class implements the definition protocol by working with the corresponding source file; see " { $link "definitions" } "." ;
22
23 ABOUT: "source-files"
24
25 HELP: source-files
26 { $var-description "An assoc mapping pathname strings to " { $link source-file } " instances, representing loaded source files." } ;
27
28 HELP: path>source-file
29 { $values { "path" "a pathname string" } { "source-file" source-file } }
30 { $description "Outputs the source file associated to a path name, creating the source file first if it doesn't exist. Source files are retained in the " { $link source-files } " variable." } ;
31
32 HELP: source-file
33 { $class-description "Instances retain information about loaded source files, and have the following slots:"
34     { $slots
35         { "path" { "a pathname string." } }
36         { "top-level-form" { " - a " { $link quotation } " composed of any code not used to define new words and classes" } }
37         { "checksum" { "the CRC32 checksum of the source file's contents at the time it was most recently loaded." } }
38         { "definitions" { "a pair of assocs, containing definitions and classes defined in this source file, respectively" } }
39         { "main" { "a word that gets called if you " { $link run } " the vocabulary" } }
40     }
41 } ;
42
43 HELP: record-checksum
44 { $values { "lines" "a sequence of strings" } { "source-file" source-file } }
45 { $description "Records the CRC32 checksum of the source file's contents." }
46 $low-level-note ;
47
48 HELP: reset-checksums
49 { $description "Resets recorded modification times and CRC32 checksums for all loaded source files, creating a checkpoint for " { $link "vocabs.refresh" } "." } ;
50
51 HELP: forget-source
52 { $values { "path" "a pathname string" } }
53 { $description "Forgets all information known about a source file." }
54 { $notes "This word must be called from inside " { $link with-compilation-unit } "." } ;
55
56 HELP: record-definitions
57 { $values { "source-file" source-file } }
58 { $description "Records that all " { $link new-definitions } " were defined in " { $snippet "file" } "." } ;
59
60 HELP: rollback-source-file
61 { $values { "source-file" source-file } }
62 { $description "Records information to the source file after an incomplete parse which ended with an error." } ;
63
64 HELP: current-source-file
65 { $var-description "Stores the " { $link source-file } " being parsed. The " { $snippet "path" } " of this object comes from the input parameter to " { $link with-source-file } "." } ;