Merge branch 'master' of git://factorcode.org/git/factor

release
Slava Pestov 2007-11-09 03:02:55 -05:00
commit aee2a65c4f
25 changed files with 38 additions and 22 deletions

View File

@ -64,3 +64,7 @@ cell 8 = [
[ 0 B{ 1 2 3 } <displaced-alien> alien-address ] unit-test-fails
[ 1 1 <displaced-alien> ] unit-test-fails
[ f ] [ 0 B{ 1 2 3 } <displaced-alien> pinned-c-ptr? ] unit-test
[ "( displaced alien )" ] [ 0 B{ 1 2 3 } <displaced-alien> unparse ] unit-test

View File

@ -18,7 +18,7 @@ PREDICATE: alien pinned-alien
underlying-alien pinned-c-ptr? ;
UNION: pinned-c-ptr
alien POSTPONE: f ;
pinned-alien POSTPONE: f ;
UNION: c-ptr
alien bit-array byte-array float-array POSTPONE: f ;

View File

@ -68,3 +68,7 @@ TYPEDEF: int* MyIntArray
TYPEDEF: uchar* MyLPBYTE
[ t ] [ "char*" c-type "MyLPBYTE" c-type eq? ] unit-test
[
0 B{ 1 2 3 4 } <displaced-alien> <void*>
] unit-test-fails

View File

@ -3,7 +3,7 @@
USING: arrays alien alien.c-types alien.structs kernel math
namespaces parser sequences words quotations math.parser
splitting effects prettyprint prettyprint.sections
prettyprint.backend assocs ;
prettyprint.backend assocs combinators ;
IN: alien.syntax
<PRIVATE
@ -53,10 +53,10 @@ PRIVATE>
parsing
M: alien pprint*
dup expired? [
drop "( alien expired )" text
] [
\ ALIEN: [ alien-address pprint* ] pprint-prefix
] if ;
{
{ [ dup expired? ] [ drop "( alien expired )" text ] }
{ [ dup pinned-c-ptr? not ] [ drop "( displaced alien )" text ] }
{ [ t ] [ \ ALIEN: [ alien-address pprint* ] pprint-prefix ] }
} cond ;
M: dll pprint* dll-path dup "DLL\" " pprint-string ;

View File

@ -120,10 +120,6 @@ HELP: vocab-tests-path
{ $values { "vocab" "a vocabulary specifier" } { "path/f" "a pathname string or " { $link f } } }
{ $description "Outputs a pathname where the unit tests for " { $snippet "vocab" } " might be found. Outputs " { $link f } " if the vocabulary does not have a directory on disk." } ;
HELP: (refresh)
{ $values { "prefix" string } { "seq" "a sequence of strings" } }
{ $description "Reloads source files and documentation belonging to loaded vocabularies whose names are prefixed by " { $snippet "prefix" } " which have been modified on disk. Also outputs a sequence of reloaded vocabularies." } ;
HELP: refresh
{ $values { "prefix" string } }
{ $description "Reloads source files and documentation belonging to loaded vocabularies whose names are prefixed by " { $snippet "prefix" } " which have been modified on disk." } ;
@ -131,7 +127,7 @@ HELP: refresh
HELP: refresh-all
{ $description "Reloads source files and documentation for all loaded vocabularies which have been modified on disk." } ;
{ refresh (refresh) refresh-all } related-words
{ refresh refresh-all } related-words
HELP: vocab-file-contents
{ $values { "vocab" "a vocabulary specifier" } { "name" string } { "seq" "a sequence of lines, or " { $link f } } }

View File

@ -119,9 +119,10 @@ SYMBOL: load-help?
"To define one, refer to \\ MAIN: help" print
] ?if ;
: modified ( assoc -- seq )
[ nip dup [ source-modified? ] when ] assoc-subset
keys ;
: modified ( seq quot -- seq )
[ dup ] swap compose { } map>assoc
[ nip ] assoc-subset
[ nip source-modified? ] assoc-subset keys ; inline
: vocab-path+ ( vocab path -- newpath )
swap vocab-root dup [ swap path+ ] [ 2drop f ] if ;
@ -136,19 +137,26 @@ SYMBOL: load-help?
dup vocab-docs vocab-path+ ;
: modified-sources ( vocabs -- seq )
[ dup vocab-source-path ] { } map>assoc modified ;
[ vocab-source-path ] modified ;
: modified-docs ( vocabs -- seq )
[ dup vocab-docs-path ] { } map>assoc modified ;
[ vocab-docs-path ] modified ;
: (refresh) ( prefix -- seq )
: update-roots ( vocabs -- )
[ dup find-vocab-root swap vocab set-vocab-root ] each ;
: to-refresh ( prefix -- seq )
child-vocabs
dup modified-sources swap modified-docs 2dup
dup update-roots
dup modified-sources swap modified-docs ;
: do-refresh ( modified-sources modified-docs -- )
2dup
[ f swap set-vocab-docs-loaded? ] each
[ f swap set-vocab-source-loaded? ] each
append prune dup [ [ require ] each ] no-parse-hook ;
append prune [ [ require ] each ] no-parse-hook ;
: refresh ( prefix -- ) (refresh) drop ;
: refresh ( prefix -- ) to-refresh do-refresh ;
: refresh-all ( -- ) "" refresh ;

View File

@ -76,4 +76,5 @@ TUPLE: expected-error ;
: test-all ( -- ) "" test ;
: test-changes ( -- ) "" (refresh) run-vocab-tests ;
: test-changes ( -- )
"" to-refresh dupd do-refresh run-vocab-tests ;

View File

@ -8,6 +8,9 @@ void flush_icache(CELL start, CELL len)
identically to the below assembly. */
/* result = syscall(__ARM_NR_cacheflush,start,start + len,0); */
/* Assembly swiped from
http://lists.arm.linux.org.uk/pipermail/linux-arm/2002-July/003931.html
*/
__asm__ __volatile__ (
"mov r0, %1\n"
"sub r1, %2, #1\n"