ABOUT: updates vocabulary
parent
1d3205c69e
commit
f7f43fa689
|
@ -30,7 +30,7 @@ crossref off
|
|||
! Bring up a bare cross-compiling vocabulary.
|
||||
"syntax" vocab vocab-words bootstrap-syntax set
|
||||
H{ } clone dictionary set
|
||||
H{ } clone changed-words set
|
||||
H{ } clone changed-definitions set
|
||||
H{ } clone forgotten-definitions set
|
||||
H{ } clone root-cache set
|
||||
H{ } clone source-files set
|
||||
|
|
|
@ -174,7 +174,7 @@ M: tuple-class update-class
|
|||
2drop
|
||||
[
|
||||
[ update-tuples-after ]
|
||||
[ changed-word ]
|
||||
[ changed-definition ]
|
||||
[ redefined ]
|
||||
tri
|
||||
] each-subclass
|
||||
|
|
|
@ -56,12 +56,12 @@ GENERIC: definitions-changed ( assoc obj -- )
|
|||
[ drop word? ] assoc-subset
|
||||
[ drop word-vocabulary dup [ vocab ] when dup ] assoc-map ;
|
||||
|
||||
: changed-definitions ( -- assoc )
|
||||
: updated-definitions ( -- assoc )
|
||||
H{ } clone
|
||||
dup forgotten-definitions get update
|
||||
dup new-definitions get first update
|
||||
dup new-definitions get second update
|
||||
dup changed-words get update
|
||||
dup changed-definitions get update
|
||||
dup dup changed-vocabs update ;
|
||||
|
||||
: compile ( words -- )
|
||||
|
@ -73,7 +73,7 @@ SYMBOL: outdated-tuples
|
|||
SYMBOL: update-tuples-hook
|
||||
|
||||
: call-recompile-hook ( -- )
|
||||
changed-words get keys
|
||||
changed-definitions get keys [ word? ] subset
|
||||
compiled-usages recompile-hook get call ;
|
||||
|
||||
: call-update-tuples-hook ( -- )
|
||||
|
@ -83,11 +83,11 @@ SYMBOL: update-tuples-hook
|
|||
call-recompile-hook
|
||||
call-update-tuples-hook
|
||||
dup [ drop crossref? ] assoc-contains? modify-code-heap
|
||||
changed-definitions notify-definition-observers ;
|
||||
updated-definitions notify-definition-observers ;
|
||||
|
||||
: with-compilation-unit ( quot -- )
|
||||
[
|
||||
H{ } clone changed-words set
|
||||
H{ } clone changed-definitions set
|
||||
H{ } clone forgotten-definitions set
|
||||
H{ } clone outdated-tuples set
|
||||
<definitions> new-definitions set
|
||||
|
|
|
@ -5,6 +5,13 @@ USING: kernel sequences namespaces assocs graphs ;
|
|||
|
||||
ERROR: no-compilation-unit definition ;
|
||||
|
||||
SYMBOL: changed-definitions
|
||||
|
||||
: changed-definition ( defspec -- )
|
||||
dup changed-definitions get
|
||||
[ no-compilation-unit ] unless*
|
||||
set-at ;
|
||||
|
||||
GENERIC: where ( defspec -- loc )
|
||||
|
||||
M: object where drop f ;
|
||||
|
|
|
@ -144,19 +144,12 @@ PRIVATE>
|
|||
: redefined ( word -- )
|
||||
H{ } clone visited [ (redefined) ] with-variable ;
|
||||
|
||||
SYMBOL: changed-words
|
||||
|
||||
: changed-word ( word -- )
|
||||
dup changed-words get
|
||||
[ no-compilation-unit ] unless*
|
||||
set-at ;
|
||||
|
||||
: define ( word def -- )
|
||||
[ ] like
|
||||
over unxref
|
||||
over redefined
|
||||
over set-word-def
|
||||
dup changed-word
|
||||
dup changed-definition
|
||||
dup crossref? [ dup xref ] when drop ;
|
||||
|
||||
: define-declared ( word def effect -- )
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
! Copyright (C) 2005, 2007 Slava Pestov.
|
||||
! Copyright (C) 2005, 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: arrays kernel parser sequences words help help.topics
|
||||
namespaces vocabs definitions compiler.units ;
|
||||
|
@ -16,4 +16,7 @@ IN: help.syntax
|
|||
over add-article >link r> remember-definition ; parsing
|
||||
|
||||
: ABOUT:
|
||||
scan-object in get vocab set-vocab-help ; parsing
|
||||
scan-object
|
||||
in get vocab
|
||||
dup changed-definition
|
||||
set-vocab-help ; parsing
|
||||
|
|
Loading…
Reference in New Issue