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
help.definitions io io.files kernel namespaces sequences
parser vocabs vocabs.loader vocabs.loader.private accessors assocs ;
USING: accessors assocs kernel namespaces sequences vocabs
vocabs.loader vocabs.loader.private ;
IN: bootstrap.help
: load-help ( -- )
"help" require
"help.topics" require
"help.syntax" require
"help.crossref" require
"help.definitions" require
"help.lint" require
"help.vocabs" require

View File

@ -3,10 +3,10 @@
USING: accessors arrays assocs classes classes.struct
classes.tuple combinators combinators.short-circuit debugger
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
summary unicode.categories vocabs vocabs.loader words
words.constant words.symbol ;
summary tools.destructors unicode.categories vocabs
vocabs.loader words words.constant words.symbol ;
FROM: sets => members ;
IN: help.lint.checks
@ -21,7 +21,7 @@ SYMBOL: all-vocabs
SYMBOL: vocab-articles
: check-example ( element -- )
! [
[
'[
_ rest [
but-last "\n" join
@ -29,10 +29,10 @@ SYMBOL: vocab-articles
"\n" ?tail drop
] keep
last assert=
] vocabs-quot get call( quot -- ) ;
! ] leaks members length [
! "%d disposable(s) leaked in example" sprintf simple-lint-error
! ] unless-zero ;
] vocabs-quot get call( quot -- )
] leaks members length [
"%d disposable(s) leaked in example" sprintf simple-lint-error
] unless-zero ;
: check-examples ( element -- )
\ $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
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 } "." ;
@ -24,11 +25,13 @@ 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: "Use the " { $link leaks. } " combinator to track down resource leaks." ;
HELP: TIP:
{ $syntax "TIP: content ;" }
{ $values { "content" "a markup element" } }
{ $description "Defines a new tip of the day." } ;
ARTICLE: "all-tips-of-the-day" "All tips of the day"
{ $tips-of-the-day } ;
@ -38,4 +41,4 @@ ARTICLE: "tips-of-the-day" "Tips of the day"
"All tips defined so far:"
{ $subsections "all-tips-of-the-day" } ;
ABOUT: "tips-of-the-day"
ABOUT: "tips-of-the-day"

View File

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

View File

@ -1,6 +1,6 @@
! Copyright (C) 2009 Slava Pestov.
! 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
HELP: disposables.
@ -21,8 +21,6 @@ HELP: 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"
"The " { $vocab-link "tools.destructors" } " vocabulary provides words for tracking down resource leaks."
{ $subsections