help.lint.checks: allow $slot to be used with struct-class.

db4
John Benediktsson 2014-06-08 18:12:26 -07:00
parent de12140505
commit 5986f9cbe3
1 changed files with 11 additions and 7 deletions

View File

@ -1,11 +1,12 @@
! 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: accessors arrays assocs classes classes.tuple combinators USING: accessors arrays assocs classes classes.struct
combinators.short-circuit debugger definitions effects eval classes.tuple combinators combinators.short-circuit debugger
formatting fry grouping help help.markup help.topics io definitions effects eval formatting fry grouping help
io.streams.string kernel macros namespaces sequences help.markup help.topics io io.streams.string kernel macros
sequences.deep sets splitting strings summary unicode.categories namespaces sequences sequences.deep sets splitting strings
vocabs vocabs.loader words words.constant words.symbol ; summary unicode.categories vocabs vocabs.loader words
words.constant words.symbol ;
FROM: sets => members ; FROM: sets => members ;
IN: help.lint.checks IN: help.lint.checks
@ -152,7 +153,10 @@ SYMBOL: vocab-articles
: check-class-description ( word element -- ) : check-class-description ( word element -- )
\ $class-description swap elements over class? [ \ $class-description swap elements over class? [
[ all-slots [ name>> ] map ] [ extract-slots ] bi* [
dup struct-class? [ struct-slots ] [ all-slots ] if
[ name>> ] map
] [ extract-slots ] bi*
[ swap member? not ] with filter [ [ swap member? not ] with filter [
", " join "Described $slot does not exist: " prepend ", " join "Described $slot does not exist: " prepend
simple-lint-error simple-lint-error