Use change-vocabulary-coverage word for toggle-coverage too to handle .private vocabs
parent
c062c24ead
commit
571d619442
|
@ -8,14 +8,16 @@ TUPLE: coverage < identity-tuple executed? ;
|
||||||
|
|
||||||
C: <coverage> coverage
|
C: <coverage> coverage
|
||||||
|
|
||||||
: private-vocab-name ( string -- string' )
|
|
||||||
".private" ?tail drop ".private" append ;
|
|
||||||
|
|
||||||
GENERIC: coverage-on ( object -- )
|
GENERIC: coverage-on ( object -- )
|
||||||
|
|
||||||
GENERIC: coverage-off ( object -- )
|
GENERIC: coverage-off ( object -- )
|
||||||
|
|
||||||
: change-coverage ( string quot -- )
|
<PRIVATE
|
||||||
|
|
||||||
|
: private-vocab-name ( string -- string' )
|
||||||
|
".private" ?tail drop ".private" append ;
|
||||||
|
|
||||||
|
: change-vocabulary-coverage ( string quot -- )
|
||||||
over ".private" tail? [
|
over ".private" tail? [
|
||||||
[ words ] dip each
|
[ words ] dip each
|
||||||
] [
|
] [
|
||||||
|
@ -23,11 +25,13 @@ GENERIC: coverage-off ( object -- )
|
||||||
[ [ words ] dip each ] 2bi
|
[ [ words ] dip each ] 2bi
|
||||||
] if ; inline
|
] if ; inline
|
||||||
|
|
||||||
|
PRIVATE>
|
||||||
|
|
||||||
M: string coverage-on
|
M: string coverage-on
|
||||||
[ coverage-on ] change-coverage ;
|
[ coverage-on ] change-vocabulary-coverage ;
|
||||||
|
|
||||||
M: string coverage-off ( vocabulary -- )
|
M: string coverage-off ( vocabulary -- )
|
||||||
[ coverage-off ] change-coverage ;
|
[ coverage-off ] change-vocabulary-coverage ;
|
||||||
|
|
||||||
M: word coverage-on ( word -- )
|
M: word coverage-on ( word -- )
|
||||||
H{ } clone [ "coverage" set-word-prop ] 2keep
|
H{ } clone [ "coverage" set-word-prop ] 2keep
|
||||||
|
@ -42,7 +46,7 @@ M: word coverage-off ( word -- )
|
||||||
GENERIC: toggle-coverage ( object -- )
|
GENERIC: toggle-coverage ( object -- )
|
||||||
|
|
||||||
M: string toggle-coverage
|
M: string toggle-coverage
|
||||||
words [ toggle-coverage ] each ;
|
[ toggle-coverage ] change-vocabulary-coverage ;
|
||||||
|
|
||||||
M: word toggle-coverage
|
M: word toggle-coverage
|
||||||
dup "coverage" word-prop [
|
dup "coverage" word-prop [
|
||||||
|
|
Loading…
Reference in New Issue