compiler work, file-responder fix
parent
b30c92eb6f
commit
5b10aac530
|
@ -58,16 +58,19 @@ SYMBOL: compiled-xts
|
|||
cell compile-aligned
|
||||
compiled-offset swap compiled-xts acons@ ;
|
||||
|
||||
: commit-xt ( xt word -- )
|
||||
t over "compiled" set-word-property set-word-xt ;
|
||||
|
||||
: commit-xts ( -- )
|
||||
compiled-xts get [ unswons set-word-xt ] each
|
||||
compiled-xts get [ unswons commit-xt ] each
|
||||
compiled-xts off ;
|
||||
|
||||
: compiled-xt ( word -- xt )
|
||||
dup compiled-xts get assoc [ nip ] [ word-xt ] ifte* ;
|
||||
|
||||
! "fixup-xts" is a list of [ where word relative ] pairs; the xt
|
||||
! of word when its done compiling will be written to the offset,
|
||||
! relative to the offset.
|
||||
! "deferred-xts" is a list of [ where word relative ] pairs; the
|
||||
! xt of word when its done compiling will be written to the
|
||||
! offset, relative to the offset.
|
||||
|
||||
SYMBOL: deferred-xts
|
||||
|
||||
|
@ -90,6 +93,19 @@ SYMBOL: compile-words
|
|||
primitive?
|
||||
] ifte ;
|
||||
|
||||
: compiling? ( word -- ? )
|
||||
#! A word that is compiling or already compiled will not be
|
||||
#! added to the list of words to be compiled.
|
||||
dup compiled? [
|
||||
drop t
|
||||
] [
|
||||
dup compile-words get contains? [
|
||||
drop t
|
||||
] [
|
||||
compiled-xts get assoc
|
||||
] ifte
|
||||
] ifte ;
|
||||
|
||||
: fixup-deferred-xt ( word where relative -- )
|
||||
rot dup compiled? [
|
||||
compiled-xt swap - swap set-compiled-cell
|
||||
|
|
|
@ -76,7 +76,7 @@ USE: unparser
|
|||
|
||||
: serve-directory ( filename -- )
|
||||
"/" ?str-tail [
|
||||
dup "index.html" cat2 dup exists? [
|
||||
dup "/index.html" cat2 dup exists? [
|
||||
serve-file
|
||||
] [
|
||||
drop list-directory
|
||||
|
|
|
@ -101,7 +101,7 @@ USE: url-encoding
|
|||
] when* "/" ?str-tail drop ;
|
||||
|
||||
: file-link-href ( path -- href )
|
||||
<% "/file/" % resolve-file-link url-encode % %> ;
|
||||
<% "/" % resolve-file-link url-encode % %> ;
|
||||
|
||||
: file-link-tag ( style quot -- )
|
||||
over "file-link" swap assoc [
|
||||
|
|
|
@ -67,7 +67,7 @@ USE: vectors
|
|||
"X re-edit -- edit the expression with number X." print
|
||||
"history" get print-numbered-vector ;
|
||||
|
||||
: get-history ( index -- )
|
||||
: get-history ( index -- str )
|
||||
"history" get vector-nth ;
|
||||
|
||||
: redo ( index -- )
|
||||
|
|
Loading…
Reference in New Issue