! Copyright (C) 2006, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: assocs continuations fry help help.lint.checks help.topics io kernel namespaces parser sequences source-files.errors tools.vocabs vocabs words classes locals ; IN: help.lint SYMBOL: lint-failures lint-failures [ H{ } clone ] initialize TUPLE: help-lint-error < source-file-error ; SYMBOL: +help-lint-failure+ M: help-lint-error source-file-error-type drop +help-lint-failure+ ; ( error topic -- help-lint-error ) \ help-lint-error ; PRIVATE> : help-lint-error ( error topic -- ) over [ [ ] keep lint-failures get set-at ] [ nip lint-failures get delete-at ] if ; link dup '[ _ [ check-article-title ] [ article-content check-markup ] bi ] check-something ; : check-about ( vocab -- ) dup '[ _ vocab-help [ article drop ] when* ] check-something ; : check-vocab ( vocab -- ) "Checking " write dup write "..." print vocab [ check-about ] [ words [ check-word ] each ] [ vocab-articles get at [ check-article ] each ] tri ; PRIVATE> : help-lint ( prefix -- ) [ all-vocabs-seq [ vocab-name ] map all-vocabs set group-articles vocab-articles set child-vocabs [ check-vocab ] each ] with-scope ; : help-lint-all ( -- ) "" help-lint ; : unlinked-words ( words -- seq ) all-word-help [ article-parent not ] filter ; : linked-undocumented-words ( -- seq ) all-words [ word-help not ] filter [ article-parent ] filter [ predicate? not ] filter ; MAIN: help-lint