]> gitweb.factorcode.org Git - factor.git/commitdiff
help.lint.checks: prettyprints the examples stack automatically.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 4 May 2017 01:15:36 +0000 (18:15 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 4 May 2017 01:15:36 +0000 (18:15 -0700)
This allows us to not have to "USE: prettyprint" and "." in the examples.
Much cleaner this way!

basis/help/lint/checks/checks.factor

index e5f3a93e4a40bb936df721ee94d6616c2b0e56a9..1c2d648cca4642ace85f12ff79a5c2655a960079 100644 (file)
@@ -1,12 +1,12 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 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 math
-namespaces sequences sequences.deep sets splitting strings
-summary tools.destructors unicode vocabs vocabs.loader words
-words.constant words.symbol ;
+classes.tuple combinators combinators.short-circuit
+combinators.smart debugger definitions effects eval formatting
+fry grouping help help.markup help.topics io io.streams.string
+kernel macros math namespaces prettyprint sequences
+sequences.deep sets splitting strings summary tools.destructors
+unicode vocabs vocabs.loader words words.constant words.symbol ;
 IN: help.lint.checks
 
 ERROR: simple-lint-error message ;
@@ -32,8 +32,9 @@ SYMBOL: vocab-articles
     [
         '[
             _ rest [
-                but-last "\n" join
-                [ (eval>string) ] call( code -- output )
+                but-last "\n" join parse-string [
+                    [ output>array [ . ] each ] call( quot -- )
+                ] with-string-writer
                 "\n" ?tail drop
             ] keep
             last assert=