Merge slava@10.0.0.2:factor into smart_recompile
commit
81de7fc696
|
@ -3,7 +3,7 @@
|
||||||
USING: kernel.private ;
|
USING: kernel.private ;
|
||||||
IN: kernel
|
IN: kernel
|
||||||
|
|
||||||
: version ( -- str ) "0.91" ; foldable
|
: version ( -- str ) "0.92" ; foldable
|
||||||
|
|
||||||
! Stack stuff
|
! Stack stuff
|
||||||
: roll ( x y z t -- y z t x ) >r rot r> swap ; inline
|
: roll ( x y z t -- y z t x ) >r rot r> swap ; inline
|
||||||
|
|
|
@ -195,11 +195,11 @@ TUPLE: one-word-elt ;
|
||||||
|
|
||||||
M: one-word-elt prev-elt
|
M: one-word-elt prev-elt
|
||||||
drop
|
drop
|
||||||
[ [ f -rot >r 1- r> (prev-word) ] (word-elt) ] (prev-char) ;
|
[ f -rot >r 1- r> (prev-word) ] (word-elt) ;
|
||||||
|
|
||||||
M: one-word-elt next-elt
|
M: one-word-elt next-elt
|
||||||
drop
|
drop
|
||||||
[ [ f -rot (next-word) ] (word-elt) ] (next-char) ;
|
[ f -rot (next-word) ] (word-elt) ;
|
||||||
|
|
||||||
TUPLE: word-elt ;
|
TUPLE: word-elt ;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
USING: tools.deploy.config ;
|
||||||
|
H{
|
||||||
|
{ deploy-compiler? t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
|
{ deploy-ui? t }
|
||||||
|
{ deploy-reflection 1 }
|
||||||
|
{ deploy-name "springies.models.2x2snake" }
|
||||||
|
{ deploy-c-types? f }
|
||||||
|
{ deploy-word-defs? f }
|
||||||
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-math? t }
|
||||||
|
{ deploy-io 1 }
|
||||||
|
}
|
|
@ -30,6 +30,16 @@ tools.test.inference tools.test.ui models ;
|
||||||
] with-grafted-gadget
|
] with-grafted-gadget
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
[ "bar" ] [
|
||||||
|
<editor> "editor" set
|
||||||
|
"editor" get [
|
||||||
|
"bar\nbaz quux" "editor" get set-editor-string
|
||||||
|
{ 0 3 } "editor" get editor-caret set-model
|
||||||
|
"editor" get select-word
|
||||||
|
"editor" get gadget-selection
|
||||||
|
] with-grafted-gadget
|
||||||
|
] unit-test
|
||||||
|
|
||||||
{ 0 1 } [ <editor> ] unit-test-effect
|
{ 0 1 } [ <editor> ] unit-test-effect
|
||||||
|
|
||||||
"hello" <model> <field> "field" set
|
"hello" <model> <field> "field" set
|
||||||
|
|
|
@ -34,14 +34,10 @@ focused? ;
|
||||||
: field-theme ( gadget -- )
|
: field-theme ( gadget -- )
|
||||||
gray <solid> swap set-gadget-boundary ;
|
gray <solid> swap set-gadget-boundary ;
|
||||||
|
|
||||||
: construct-editor ( class -- tuple )
|
: construct-editor ( object class -- tuple )
|
||||||
>r <editor> { set-gadget-delegate } r> construct
|
>r { set-gadget-delegate } r> construct
|
||||||
dup dup set-editor-self ; inline
|
dup dup set-editor-self ; inline
|
||||||
|
|
||||||
TUPLE: source-editor ;
|
|
||||||
|
|
||||||
: <source-editor> source-editor construct-editor ;
|
|
||||||
|
|
||||||
: activate-editor-model ( editor model -- )
|
: activate-editor-model ( editor model -- )
|
||||||
2dup add-connection
|
2dup add-connection
|
||||||
dup activate-model
|
dup activate-model
|
||||||
|
@ -320,11 +316,6 @@ M: editor gadget-text* editor-string % ;
|
||||||
|
|
||||||
: end-of-document ( editor -- ) T{ doc-elt } editor-next ;
|
: end-of-document ( editor -- ) T{ doc-elt } editor-next ;
|
||||||
|
|
||||||
: selected-word ( editor -- string )
|
|
||||||
dup gadget-selection? [
|
|
||||||
dup T{ one-word-elt } select-elt
|
|
||||||
] unless gadget-selection ;
|
|
||||||
|
|
||||||
: position-caret ( editor -- )
|
: position-caret ( editor -- )
|
||||||
mouse-elt dup T{ one-char-elt } =
|
mouse-elt dup T{ one-char-elt } =
|
||||||
[ drop dup extend-selection dup editor-mark click-loc ]
|
[ drop dup extend-selection dup editor-mark click-loc ]
|
||||||
|
@ -345,9 +336,6 @@ M: editor gadget-text* editor-string % ;
|
||||||
: delete-to-end-of-line T{ one-line-elt } editor-backspace ;
|
: delete-to-end-of-line T{ one-line-elt } editor-backspace ;
|
||||||
|
|
||||||
editor "general" f {
|
editor "general" f {
|
||||||
{ T{ key-down f f "RET" } insert-newline }
|
|
||||||
{ T{ key-down f { S+ } "RET" } insert-newline }
|
|
||||||
{ T{ key-down f f "ENTER" } insert-newline }
|
|
||||||
{ T{ key-down f f "DELETE" } delete-next-character }
|
{ T{ key-down f f "DELETE" } delete-next-character }
|
||||||
{ T{ key-down f { S+ } "DELETE" } delete-next-character }
|
{ T{ key-down f { S+ } "DELETE" } delete-next-character }
|
||||||
{ T{ key-down f f "BACKSPACE" } delete-previous-character }
|
{ T{ key-down f f "BACKSPACE" } delete-previous-character }
|
||||||
|
@ -408,6 +396,11 @@ editor "caret-motion" f {
|
||||||
|
|
||||||
: select-word T{ one-word-elt } select-elt ;
|
: select-word T{ one-word-elt } select-elt ;
|
||||||
|
|
||||||
|
: selected-word ( editor -- string )
|
||||||
|
dup gadget-selection?
|
||||||
|
[ dup select-word ] unless
|
||||||
|
gadget-selection ;
|
||||||
|
|
||||||
: select-previous-character T{ char-elt } editor-select-prev ;
|
: select-previous-character T{ char-elt } editor-select-prev ;
|
||||||
|
|
||||||
: select-next-character T{ char-elt } editor-select-next ;
|
: select-next-character T{ char-elt } editor-select-next ;
|
||||||
|
@ -448,6 +441,23 @@ editor "selection" f {
|
||||||
{ T{ key-down f { S+ C+ } "END" } select-end-of-document }
|
{ T{ key-down f { S+ C+ } "END" } select-end-of-document }
|
||||||
} define-command-map
|
} define-command-map
|
||||||
|
|
||||||
|
! Multi-line editors
|
||||||
|
TUPLE: multiline-editor ;
|
||||||
|
|
||||||
|
: <multiline-editor> ( -- editor )
|
||||||
|
<editor> multiline-editor construct-editor ;
|
||||||
|
|
||||||
|
multiline-editor "general" f {
|
||||||
|
{ T{ key-down f f "RET" } insert-newline }
|
||||||
|
{ T{ key-down f { S+ } "RET" } insert-newline }
|
||||||
|
{ T{ key-down f f "ENTER" } insert-newline }
|
||||||
|
} define-command-map
|
||||||
|
|
||||||
|
TUPLE: source-editor ;
|
||||||
|
|
||||||
|
: <source-editor> ( -- editor )
|
||||||
|
<multiline-editor> source-editor construct-editor ;
|
||||||
|
|
||||||
! Fields are like editors except they edit an external model
|
! Fields are like editors except they edit an external model
|
||||||
TUPLE: field model editor ;
|
TUPLE: field model editor ;
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ deploy-gadget "toolbar" f {
|
||||||
{ f com-help }
|
{ f com-help }
|
||||||
{ f com-revert }
|
{ f com-revert }
|
||||||
{ f com-save }
|
{ f com-save }
|
||||||
{ T{ key-down f f "RETURN" } com-deploy }
|
{ T{ key-down f f "RET" } com-deploy }
|
||||||
} define-command-map
|
} define-command-map
|
||||||
|
|
||||||
: buttons,
|
: buttons,
|
||||||
|
|
|
@ -33,9 +33,8 @@ help ;
|
||||||
|
|
||||||
: <interactor> ( output -- gadget )
|
: <interactor> ( output -- gadget )
|
||||||
<source-editor>
|
<source-editor>
|
||||||
{ set-interactor-output set-gadget-delegate }
|
interactor construct-editor
|
||||||
interactor construct
|
tuck set-interactor-output
|
||||||
dup dup set-editor-self
|
|
||||||
dup init-interactor-history
|
dup init-interactor-history
|
||||||
dup init-caret-help ;
|
dup init-caret-help ;
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,8 @@ M: live-search handle-gesture* ( gadget gesture delegate -- ? )
|
||||||
|
|
||||||
TUPLE: search-field ;
|
TUPLE: search-field ;
|
||||||
|
|
||||||
: <search-field> ( -- gadget ) search-field construct-editor ;
|
: <search-field> ( -- gadget )
|
||||||
|
<editor> search-field construct-editor ;
|
||||||
|
|
||||||
search-field H{
|
search-field H{
|
||||||
{ T{ key-down f f "UP" } [ find-search-list select-previous ] }
|
{ T{ key-down f f "UP" } [ find-search-list select-previous ] }
|
||||||
|
|
|
@ -2,16 +2,18 @@ source misc/version.sh
|
||||||
|
|
||||||
TARGET=$1
|
TARGET=$1
|
||||||
|
|
||||||
if [ "$TARGET" = "x86" ]; then
|
if [ "$1" = "x86" ]; then
|
||||||
CPU="x86.32"
|
CPU="x86.32"
|
||||||
|
TARGET=macosx-x86-32
|
||||||
else
|
else
|
||||||
CPU="macosx-ppc"
|
CPU="macosx-ppc"
|
||||||
|
TARGET=macosx-ppc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BOOT_IMAGE=boot.$CPU.image
|
BOOT_IMAGE=boot.$CPU.image
|
||||||
wget http://factorcode.org/images/$VERSION/$BOOT_IMAGE
|
wget http://factorcode.org/images/$VERSION/$BOOT_IMAGE
|
||||||
|
|
||||||
make macosx-$TARGET
|
make $TARGET
|
||||||
Factor.app/Contents/MacOS/factor -i=$BOOT_IMAGE -no-user-init
|
Factor.app/Contents/MacOS/factor -i=$BOOT_IMAGE -no-user-init
|
||||||
|
|
||||||
DISK_IMAGE_DIR=Factor-$VERSION
|
DISK_IMAGE_DIR=Factor-$VERSION
|
||||||
|
@ -28,3 +30,6 @@ find core extra fonts misc unmaintained -type f \
|
||||||
-exec ./cp_dir {} $DISK_IMAGE_DIR/Factor/{} \;
|
-exec ./cp_dir {} $DISK_IMAGE_DIR/Factor/{} \;
|
||||||
hdiutil create -srcfolder "$DISK_IMAGE_DIR" -fs HFS+ \
|
hdiutil create -srcfolder "$DISK_IMAGE_DIR" -fs HFS+ \
|
||||||
-volname "$DISK_IMAGE_DIR" "$DISK_IMAGE"
|
-volname "$DISK_IMAGE_DIR" "$DISK_IMAGE"
|
||||||
|
|
||||||
|
ssh linode mkdir -p w/downloads/$VERSION/
|
||||||
|
scp $DISK_IMAGE linode:w/downloads/$VERSION/
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
source misc/version.sh
|
source misc/version.sh
|
||||||
rm -rf .git
|
rm -rf .git
|
||||||
cd ..
|
cd ..
|
||||||
tar cfz Factor-$VERSION.tgz factor/
|
tar cfz Factor-$VERSION.tar.gz factor/
|
||||||
|
|
||||||
|
ssh linode mkdir -p w/downloads/$VERSION/
|
||||||
|
scp Factor-$VERSION.tar.gz linode:w/downloads/$VERSION/
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
export VERSION=0.91
|
export VERSION=0.92
|
||||||
|
|
|
@ -22,5 +22,10 @@ rm -f Makefile
|
||||||
rm -f cp_dir
|
rm -f cp_dir
|
||||||
rm -f boot.*.image
|
rm -f boot.*.image
|
||||||
|
|
||||||
|
FILE=Factor-$VERSION-win32-$CPU.zip
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
zip -r Factor-$VERSION-win32-$CPU.zip Factor/
|
zip -r $FILE Factor/
|
||||||
|
|
||||||
|
ssh linode mkdir -p w/downloads/$VERSION/
|
||||||
|
scp $FILE linode:w/downloads/$VERSION/
|
||||||
|
|
Loading…
Reference in New Issue