help.lint.checks: re-enable leak detection.

db4
John Benediktsson 2015-05-12 10:46:37 -07:00
parent ba8caa72fb
commit a33fc84de7
5 changed files with 26 additions and 20 deletions

View File

@ -1,9 +1,13 @@
USING: help help.topics help.syntax help.crossref USING: accessors assocs kernel namespaces sequences vocabs
help.definitions io io.files kernel namespaces sequences vocabs.loader vocabs.loader.private ;
parser vocabs vocabs.loader vocabs.loader.private accessors assocs ;
IN: bootstrap.help IN: bootstrap.help
: load-help ( -- ) : load-help ( -- )
"help" require
"help.topics" require
"help.syntax" require
"help.crossref" require
"help.definitions" require
"help.lint" require "help.lint" require
"help.vocabs" require "help.vocabs" require

View File

@ -3,10 +3,10 @@
USING: accessors arrays assocs classes classes.struct USING: accessors arrays assocs classes classes.struct
classes.tuple combinators combinators.short-circuit debugger classes.tuple combinators combinators.short-circuit debugger
definitions effects eval formatting fry grouping help definitions effects eval formatting fry grouping help
help.markup help.topics io io.streams.string kernel macros help.markup help.topics io io.streams.string kernel macros math
namespaces sequences sequences.deep sets splitting strings namespaces sequences sequences.deep sets splitting strings
summary unicode.categories vocabs vocabs.loader words summary tools.destructors unicode.categories vocabs
words.constant words.symbol ; vocabs.loader words words.constant words.symbol ;
FROM: sets => members ; FROM: sets => members ;
IN: help.lint.checks IN: help.lint.checks
@ -21,7 +21,7 @@ SYMBOL: all-vocabs
SYMBOL: vocab-articles SYMBOL: vocab-articles
: check-example ( element -- ) : check-example ( element -- )
! [ [
'[ '[
_ rest [ _ rest [
but-last "\n" join but-last "\n" join
@ -29,10 +29,10 @@ SYMBOL: vocab-articles
"\n" ?tail drop "\n" ?tail drop
] keep ] keep
last assert= last assert=
] vocabs-quot get call( quot -- ) ; ] vocabs-quot get call( quot -- )
! ] leaks members length [ ] leaks members length [
! "%d disposable(s) leaked in example" sprintf simple-lint-error "%d disposable(s) leaked in example" sprintf simple-lint-error
! ] unless-zero ; ] unless-zero ;
: check-examples ( element -- ) : check-examples ( element -- )
\ $example swap elements [ check-example ] each ; \ $example swap elements [ check-example ] each ;

View File

@ -1,6 +1,7 @@
USING: debugger editors help help.apropos help.markup
help.syntax help.vocabs memory see stack-checker
tools.destructors tools.time ;
IN: help.tips IN: help.tips
USING: help.markup help.syntax debugger prettyprint see help help.vocabs
help.apropos tools.time stack-checker editors memory ;
TIP: "To look at the most recent error, run " { $link :error } ". To look at the most recent error's callstack, run " { $link :c } "." ; TIP: "To look at the most recent error, run " { $link :error } ". To look at the most recent error's callstack, run " { $link :c } "." ;
@ -24,6 +25,8 @@ TIP: "Try some simple demo applications, then look at the source code in " { $sn
TIP: "To save time on reloading big libraries such as the " { $vocab-link "furnace" } " web framework, save the image after loading them using the " { $link save } " word." ; TIP: "To save time on reloading big libraries such as the " { $vocab-link "furnace" } " web framework, save the image after loading them using the " { $link save } " word." ;
TIP: "Use the " { $link leaks. } " combinator to track down resource leaks." ;
HELP: TIP: HELP: TIP:
{ $syntax "TIP: content ;" } { $syntax "TIP: content ;" }
{ $values { "content" "a markup element" } } { $values { "content" "a markup element" } }

View File

@ -1,7 +1,8 @@
! Copyright (C) 2009 Slava Pestov. ! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: parser arrays namespaces sequences random help.markup help.stylesheet USING: accessors arrays colors.constants definitions help.markup
kernel io io.styles colors.constants definitions accessors ; help.stylesheet io io.styles kernel namespaces parser random
sequences ;
IN: help.tips IN: help.tips
SYMBOL: tips SYMBOL: tips

View File

@ -1,6 +1,6 @@
! Copyright (C) 2009 Slava Pestov. ! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: destructors help.markup help.syntax help.tips quotations sequences ; USING: destructors help.markup help.syntax quotations sequences ;
IN: tools.destructors IN: tools.destructors
HELP: disposables. HELP: disposables.
@ -21,8 +21,6 @@ HELP: leaks
"Runs the quotation and collects all disposables leaked by it. Used by " { $link leaks. } "." "Runs the quotation and collects all disposables leaked by it. Used by " { $link leaks. } "."
} ; } ;
TIP: "Use the " { $link leaks. } " combinator to track down resource leaks." ;
ARTICLE: "tools.destructors" "Destructor tools" ARTICLE: "tools.destructors" "Destructor tools"
"The " { $vocab-link "tools.destructors" } " vocabulary provides words for tracking down resource leaks." "The " { $vocab-link "tools.destructors" } " vocabulary provides words for tracking down resource leaks."
{ $subsections { $subsections