1 ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors assocs benchmark bootstrap.stage2 command-line
4 compiler.errors generic help.html help.lint io io.directories
5 io.encodings.utf8 io.files kernel locals mason.common namespaces
6 parser.notes sequences sets sorting source-files.errors system
7 tools.errors tools.test tools.time vocabs.errors
8 vocabs.hierarchy vocabs.refresh words ;
13 [ keys load-all-vocabs-file to-file ]
14 [ load-all-errors-file utf8 [ load-failures. ] with-file-writer ]
17 GENERIC: word-vocabulary ( word -- vocabulary )
19 M: word word-vocabulary vocabulary>> ;
21 M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
23 :: do-step ( errors summary-file details-file -- )
25 [ error-type +linkage-error+ eq? not ] filter
26 [ file>> ] map members natural-sort summary-file to-file
27 errors details-file utf8 [ errors. ] with-file-writer ;
31 test-all test-failures get
37 help-lint-all lint-failures get values
42 : do-benchmarks ( -- )
44 [ benchmarks-file to-file ] [
45 [ keys benchmark-error-vocabs-file to-file ]
46 [ benchmark-error-messages-file utf8 [ benchmark-errors. ] with-file-writer ] bi
49 : do-compile-errors ( -- )
50 compiler-errors get values
52 compiler-error-messages-file
55 : outdated-core-vocabs ( -- modified-sources modified-docs any? )
56 "" to-refresh drop 2dup [ empty? not ] either? ;
58 : outdated-boot-image. ( modified-sources modified-docs -- )
59 "Boot image is out of date. Changed vocabs:" print
63 : check-boot-image ( -- ? )
64 outdated-core-vocabs [ outdated-boot-image. t ] [ 2drop f ] if ;
68 ".factor-mason-rc" rc-path try-user-init
71 : check-user-init-errors ( -- ? )
72 user-init-errors get-global assoc-empty?
73 [ f ] [ :user-init-errors t ] if ;
76 f parser-quiet? set-global
78 run-mason-rc check-user-init-errors [ 1 exit ] when
79 bootstrap-time get boot-time-file to-file
80 check-boot-image [ 1 exit ] when
81 [ do-load ] benchmark load-time-file to-file
82 [ generate-help ] benchmark html-help-time-file to-file
83 [ do-tests ] benchmark test-time-file to-file
84 [ do-help-lint ] benchmark help-lint-time-file to-file
85 [ do-benchmarks ] benchmark benchmark-time-file to-file