Merge branch 'master' of git://factorcode.org/git/factor
commit
8c29599e97
|
@ -12,9 +12,15 @@ io.encodings.binary math.order math.private accessors
|
|||
slots.private compiler.units ;
|
||||
IN: bootstrap.image
|
||||
|
||||
: arch ( os cpu -- arch )
|
||||
{
|
||||
{ "ppc" [ "-ppc" append ] }
|
||||
{ "x86.64" [ "winnt" = "winnt" "unix" ? "-x86.64" append ] }
|
||||
[ nip ]
|
||||
} case ;
|
||||
|
||||
: my-arch ( -- arch )
|
||||
cpu name>>
|
||||
dup "ppc" = [ >r os name>> "-" r> 3append ] when ;
|
||||
os name>> cpu name>> arch ;
|
||||
|
||||
: boot-image-name ( arch -- string )
|
||||
"boot." swap ".image" 3append ;
|
||||
|
|
|
@ -8,5 +8,5 @@ IN: bootstrap.x86
|
|||
: arg0 ( -- reg ) RDI ;
|
||||
: arg1 ( -- reg ) RSI ;
|
||||
|
||||
<< "resource:basis/cpu/x86/64/bootstrap.factor" parsed-file parsed >>
|
||||
<< "resource:basis/cpu/x86/64/bootstrap.factor" parse-file parsed >>
|
||||
call
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
unportable
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel layouts system compiler.cfg.registers
|
||||
cpu.architecture cpu.x86.assembler ;
|
||||
cpu.architecture cpu.x86.assembler cpu.x86 ;
|
||||
IN: cpu.x86.64.unix
|
||||
|
||||
M: int-regs param-regs drop { RDI RSI RDX RCX R8 R9 } ;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
unportable
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Slava Pestov, Eduardo Cavazos.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel sequences combinators parser splitting math
|
||||
quotations arrays make qualified words ;
|
||||
quotations arrays make words ;
|
||||
IN: fry
|
||||
|
||||
: _ ( -- * ) "Only valid inside a fry" throw ;
|
||||
|
|
|
@ -32,3 +32,14 @@ HELP: RENAME:
|
|||
"RENAME: + math => -"
|
||||
"2 3 - ! => 5" } } ;
|
||||
|
||||
ARTICLE: "qualified" "Qualified word lookup"
|
||||
"The " { $vocab-link "qualified" } " vocabulary provides a handful of parsing words which give more control over word lookup than is offered by " { $link POSTPONE: USE: } " and " { $link POSTPONE: USING: } "."
|
||||
$nl
|
||||
"These words are useful when there is no way to avoid using two vocabularies with identical word names in the same source file."
|
||||
{ $subsection POSTPONE: QUALIFIED: }
|
||||
{ $subsection POSTPONE: QUALIFIED-WITH: }
|
||||
{ $subsection POSTPONE: FROM: }
|
||||
{ $subsection POSTPONE: EXCLUDE: }
|
||||
{ $subsection POSTPONE: RENAME: } ;
|
||||
|
||||
ABOUT: "qualified"
|
||||
|
|
|
@ -1,24 +1,33 @@
|
|||
USING: tools.test qualified ;
|
||||
IN: foo
|
||||
USING: tools.test qualified eval accessors parser ;
|
||||
IN: qualified.tests.foo
|
||||
: x 1 ;
|
||||
IN: bar
|
||||
: y 5 ;
|
||||
IN: qualified.tests.bar
|
||||
: x 2 ;
|
||||
IN: baz
|
||||
: y 4 ;
|
||||
IN: qualified.tests.baz
|
||||
: x 3 ;
|
||||
|
||||
QUALIFIED: foo
|
||||
QUALIFIED: bar
|
||||
[ 1 2 3 ] [ foo:x bar:x x ] unit-test
|
||||
QUALIFIED: qualified.tests.foo
|
||||
QUALIFIED: qualified.tests.bar
|
||||
[ 1 2 3 ] [ qualified.tests.foo:x qualified.tests.bar:x x ] unit-test
|
||||
|
||||
QUALIFIED-WITH: bar p
|
||||
QUALIFIED-WITH: qualified.tests.bar p
|
||||
[ 2 ] [ p:x ] unit-test
|
||||
|
||||
RENAME: x baz => y
|
||||
RENAME: x qualified.tests.baz => y
|
||||
[ 3 ] [ y ] unit-test
|
||||
|
||||
FROM: baz => x ;
|
||||
FROM: qualified.tests.baz => x ;
|
||||
[ 3 ] [ x ] unit-test
|
||||
[ 3 ] [ y ] unit-test
|
||||
|
||||
EXCLUDE: bar => x ;
|
||||
EXCLUDE: qualified.tests.bar => x ;
|
||||
[ 3 ] [ x ] unit-test
|
||||
[ 4 ] [ y ] unit-test
|
||||
|
||||
[ "USE: qualified IN: qualified.tests FROM: qualified.tests => doesnotexist ;" eval ]
|
||||
[ error>> no-word-error? ] must-fail-with
|
||||
|
||||
[ "USE: qualified IN: qualified.tests RENAME: doesnotexist qualified.tests => blah" eval ]
|
||||
[ error>> no-word-error? ] must-fail-with
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
! Copyright (C) 2007, 2008 Daniel Ehrenberg.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel sequences assocs hashtables parser lexer
|
||||
vocabs words namespaces vocabs.loader debugger sets ;
|
||||
vocabs words namespaces vocabs.loader debugger sets fry ;
|
||||
IN: qualified
|
||||
|
||||
: define-qualified ( vocab-name prefix-name -- )
|
||||
[ load-vocab vocab-words ] [ CHAR: : suffix ] bi*
|
||||
[ -rot >r append r> ] curry assoc-map
|
||||
'[ [ [ _ ] dip append ] dip ] assoc-map
|
||||
use get push ;
|
||||
|
||||
: QUALIFIED:
|
||||
|
@ -19,27 +19,27 @@ IN: qualified
|
|||
|
||||
: expect=> ( -- ) scan "=>" assert= ;
|
||||
|
||||
: partial-vocab ( words name -- assoc )
|
||||
dupd [
|
||||
lookup [ "No such word: " swap append throw ] unless*
|
||||
] curry map zip ;
|
||||
|
||||
: partial-vocab-ignoring ( words name -- assoc )
|
||||
[ load-vocab vocab-words keys swap diff ] keep partial-vocab ;
|
||||
|
||||
: EXCLUDE:
|
||||
#! Syntax: EXCLUDE: vocab => words ... ;
|
||||
scan expect=>
|
||||
";" parse-tokens swap partial-vocab-ignoring use get push ; parsing
|
||||
: partial-vocab ( words vocab -- assoc )
|
||||
'[ dup _ lookup [ no-word-error ] unless* ]
|
||||
{ } map>assoc ;
|
||||
|
||||
: FROM:
|
||||
#! Syntax: FROM: vocab => words... ;
|
||||
scan dup load-vocab drop expect=>
|
||||
";" parse-tokens swap partial-vocab use get push ; parsing
|
||||
|
||||
: partial-vocab-excluding ( words vocab -- assoc )
|
||||
[ load-vocab vocab-words keys swap diff ] keep partial-vocab ;
|
||||
|
||||
: EXCLUDE:
|
||||
#! Syntax: EXCLUDE: vocab => words ... ;
|
||||
scan expect=>
|
||||
";" parse-tokens swap partial-vocab-excluding use get push ; parsing
|
||||
|
||||
: RENAME:
|
||||
#! Syntax: RENAME: word vocab => newname
|
||||
scan scan dup load-vocab drop lookup [ "No such word" throw ] unless*
|
||||
scan scan dup load-vocab drop
|
||||
dupd lookup [ ] [ no-word-error ] ?if
|
||||
expect=>
|
||||
scan associate use get push ; parsing
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ M: list focusable-child* drop t ;
|
|||
] if ;
|
||||
|
||||
: select-gadget ( gadget list -- )
|
||||
swap over children>> index
|
||||
tuck children>> index
|
||||
[ swap select-index ] [ drop ] if* ;
|
||||
|
||||
: clamp-loc ( point max -- point )
|
||||
|
|
|
@ -41,7 +41,7 @@ scroller H{
|
|||
dup model>> dependencies>> first <x-slider> >>x dup x>> @bottom grid-add
|
||||
dup model>> dependencies>> second <y-slider> >>y dup y>> @right grid-add
|
||||
|
||||
swap over model>> <viewport> >>viewport
|
||||
tuck model>> <viewport> >>viewport
|
||||
dup viewport>> @center grid-add ;
|
||||
|
||||
: <scroller> ( gadget -- scroller ) scroller new-scroller ;
|
||||
|
|
|
@ -60,10 +60,11 @@ check_gcc_version() {
|
|||
GCC_VERSION=`$CC --version`
|
||||
check_ret gcc
|
||||
if [[ $GCC_VERSION == *3.3.* ]] ; then
|
||||
$ECHO "bad!"
|
||||
$ECHO "You have a known buggy version of gcc (3.3)"
|
||||
$ECHO "Install gcc 3.4 or higher and try again."
|
||||
exit 3
|
||||
elif [[ $GCC_VERSION == *4.3.* ]] ; then
|
||||
MAKE_OPTS="$MAKE_OPTS SITE_CFLAGS=-fno-forward-propagate"
|
||||
fi
|
||||
$ECHO "ok."
|
||||
}
|
||||
|
@ -271,18 +272,18 @@ check_os_arch_word() {
|
|||
set_build_info() {
|
||||
check_os_arch_word
|
||||
MAKE_TARGET=$OS-$ARCH-$WORD
|
||||
MAKE_IMAGE_TARGET=$ARCH.$WORD
|
||||
BOOT_IMAGE=boot.$ARCH.$WORD.image
|
||||
if [[ $OS == macosx && $ARCH == ppc ]] ; then
|
||||
MAKE_IMAGE_TARGET=$OS-$ARCH
|
||||
MAKE_TARGET=$OS-$ARCH
|
||||
BOOT_IMAGE=boot.macosx-ppc.image
|
||||
fi
|
||||
if [[ $OS == linux && $ARCH == ppc ]] ; then
|
||||
MAKE_IMAGE_TARGET=$OS-$ARCH
|
||||
MAKE_TARGET=$OS-$ARCH
|
||||
BOOT_IMAGE=boot.linux-ppc.image
|
||||
MAKE_IMAGE_TARGET=macosx-ppc
|
||||
elif [[ $OS == linux && $ARCH == ppc ]] ; then
|
||||
MAKE_IMAGE_TARGET=linux-ppc
|
||||
elif [[ $OS == winnt && $ARCH == x86 && $WORD == 64 ]] ; then
|
||||
MAKE_IMAGE_TARGET=winnt-x86.64
|
||||
elif [[ $ARCH == x86 && $WORD == 64 ]] ; then
|
||||
MAKE_IMAGE_TARGET=unix-x86.64
|
||||
else
|
||||
MAKE_IMAGE_TARGET=$ARCH.$WORD
|
||||
fi
|
||||
BOOT_IMAGE=boot.$MAKE_IMAGE_TARGET.image
|
||||
}
|
||||
|
||||
parse_build_info() {
|
||||
|
@ -335,7 +336,7 @@ cd_factor() {
|
|||
}
|
||||
|
||||
invoke_make() {
|
||||
$MAKE $*
|
||||
$MAKE $MAKE_OPTS $*
|
||||
check_ret $MAKE
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ $nl
|
|||
{ $subsection POSTPONE: PRIVATE> }
|
||||
{ $subsection "vocabulary-search-errors" }
|
||||
{ $subsection "vocabulary-search-shadow" }
|
||||
{ $see-also "words" } ;
|
||||
{ $see-also "words" "qualified" } ;
|
||||
|
||||
ARTICLE: "reading-ahead" "Reading ahead"
|
||||
"Parsing words can consume input:"
|
||||
|
|
|
@ -71,10 +71,10 @@ ERROR: no-current-vocab ;
|
|||
] keep
|
||||
] { } map>assoc ;
|
||||
|
||||
TUPLE: no-word-error name ;
|
||||
ERROR: no-word-error name ;
|
||||
|
||||
: no-word ( name -- newword )
|
||||
dup no-word-error boa
|
||||
dup \ no-word-error boa
|
||||
swap words-named [ forward-reference? not ] filter
|
||||
word-restarts throw-restarts
|
||||
dup vocabulary>> (use+) ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel system accessors namespaces splitting sequences
|
||||
mason.config ;
|
||||
mason.config bootstrap.image ;
|
||||
IN: mason.platform
|
||||
|
||||
: platform ( -- string )
|
||||
|
@ -11,7 +11,7 @@ IN: mason.platform
|
|||
target-os get { "freebsd" "openbsd" "netbsd" } member? "gmake" "make" ? ;
|
||||
|
||||
: boot-image-arch ( -- string )
|
||||
target-cpu get dup "ppc" = [ target-os get "-" append prepend ] when ;
|
||||
target-os get target-cpu get arch ;
|
||||
|
||||
: boot-image-name ( -- string )
|
||||
"boot." boot-image-arch ".image" 3append ;
|
||||
|
|
|
@ -12,7 +12,7 @@ USING: mason.release.branch mason.config tools.test namespaces ;
|
|||
] with-scope
|
||||
] unit-test
|
||||
|
||||
[ { "scp" "boot.x86.64.image" "joe@blah.com:/stuff/clean/netbsd-x86-64" } ] [
|
||||
[ { "scp" "boot.unix-x86.64.image" "joe@blah.com:/stuff/clean/netbsd-x86-64" } ] [
|
||||
[
|
||||
"joe" image-username set
|
||||
"blah.com" image-host set
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel namespaces continuations debugger sequences fry
|
||||
io.files io.launcher mason.common mason.platform
|
||||
io.files io.launcher bootstrap.image qualified mason.common
|
||||
mason.config ;
|
||||
FROM: mason.config => target-os ;
|
||||
IN: mason.release.tidy
|
||||
|
||||
: common-files ( -- seq )
|
||||
images [ boot-image-name ] map
|
||||
{
|
||||
"boot.x86.32.image"
|
||||
"boot.x86.64.image"
|
||||
"boot.macosx-ppc.image"
|
||||
"boot.linux-ppc.image"
|
||||
"vm"
|
||||
"temp"
|
||||
"logs"
|
||||
|
@ -20,7 +18,8 @@ IN: mason.release.tidy
|
|||
"unmaintained"
|
||||
"unfinished"
|
||||
"build-support"
|
||||
} ;
|
||||
}
|
||||
append ;
|
||||
|
||||
: remove-common-files ( -- )
|
||||
common-files [ delete-tree ] each ;
|
||||
|
|
Loading…
Reference in New Issue