From 2dd1e54ac2e5b4abd02e854b36aa69d00b400bbd Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 16 May 2009 16:28:24 -0500 Subject: [PATCH 1/6] unix.stat.netbsd: fix code duplication with unix.statvfs.netbsd --- basis/unix/stat/netbsd/netbsd.factor | 30 ---------------------------- 1 file changed, 30 deletions(-) diff --git a/basis/unix/stat/netbsd/netbsd.factor b/basis/unix/stat/netbsd/netbsd.factor index b60a0b1adc..3b145d8af5 100644 --- a/basis/unix/stat/netbsd/netbsd.factor +++ b/basis/unix/stat/netbsd/netbsd.factor @@ -6,33 +6,3 @@ cell-bits { { 64 [ "unix.stat.netbsd.64" require ] } } case -CONSTANT: _VFS_NAMELEN 32 -CONSTANT: _VFS_MNAMELEN 1024 - -C-STRUCT: statvfs - { "ulong" "f_flag" } - { "ulong" "f_bsize" } - { "ulong" "f_frsize" } - { "ulong" "f_iosize" } - { "fsblkcnt_t" "f_blocks" } - { "fsblkcnt_t" "f_bfree" } - { "fsblkcnt_t" "f_bavail" } - { "fsblkcnt_t" "f_bresvd" } - { "fsfilcnt_t" "f_files" } - { "fsfilcnt_t" "f_ffree" } - { "fsfilcnt_t" "f_favail" } - { "fsfilcnt_t" "f_fresvd" } - { "uint64_t" "f_syncreads" } - { "uint64_t" "f_syncwrites" } - { "uint64_t" "f_asyncreads" } - { "uint64_t" "f_asyncwrites" } - { "fsid_t" "f_fsidx" } - { "ulong" "f_fsid" } - { "ulong" "f_namemax" } - { "uid_t" "f_owner" } - { { "uint32_t" 4 } "f_spare" } - { { "char" _VFS_NAMELEN } "f_fstypename" } - { { "char" _VFS_NAMELEN } "f_mntonname" } - { { "char" _VFS_NAMELEN } "f_mntfromname" } ; - -FUNCTION: int statvfs ( char* path, statvfs* buf ) ; From 7b76d64510adfe2486ea497ecaf318203cd364b1 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 16 May 2009 16:40:40 -0500 Subject: [PATCH 2/6] tools.deploy.shaker: update for parser.notes --- basis/tools/deploy/shaker/shaker.factor | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index 5a64878aee..46572de47b 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -1,12 +1,12 @@ ! Copyright (C) 2007, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays accessors io.backend io.streams.c init fry namespaces -math make assocs kernel parser lexer strings.parser vocabs sequences -sequences.private words memory kernel.private continuations io -vocabs.loader system strings sets vectors quotations byte-arrays -sorting compiler.units definitions generic generic.standard -generic.single tools.deploy.config combinators classes -slots.private ; +math make assocs kernel parser parser.notes lexer strings.parser +vocabs sequences sequences.private words memory kernel.private +continuations io vocabs.loader system strings sets vectors quotations +byte-arrays sorting compiler.units definitions generic +generic.standard generic.single tools.deploy.config combinators +classes slots.private ; QUALIFIED: bootstrap.stage2 QUALIFIED: command-line QUALIFIED: compiler.errors From 9be2a3c0802197103442a507f5ccc952c9f7bfbd Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 16 May 2009 16:54:02 -0500 Subject: [PATCH 3/6] help.html: fix escape-filename --- basis/help/html/html-tests.factor | 2 ++ basis/help/html/html.factor | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/basis/help/html/html-tests.factor b/basis/help/html/html-tests.factor index 61414cdfa2..3ba336be0b 100644 --- a/basis/help/html/html-tests.factor +++ b/basis/help/html/html-tests.factor @@ -2,3 +2,5 @@ IN: help.html.tests USING: help.html tools.test help.topics kernel ; [ ] [ "xml" >link help>html drop ] unit-test + +[ "article-foobar.html" ] [ "foobar" >link topic>filename ] unit-test \ No newline at end of file diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index 09208749b9..fbfc42829e 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -1,11 +1,13 @@ ! Copyright (C) 2008, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: io.encodings.utf8 io.encodings.ascii io.encodings.binary +USING: io.encodings.utf8 io.encodings.binary io.files io.files.temp io.directories html.streams help kernel assocs sequences make words accessors arrays help.topics vocabs vocabs.hierarchy help.vocabs namespaces prettyprint io vocabs.loader serialize fry memoize unicode.case math.order sorting debugger html xml.syntax xml.writer math.parser ; +FROM: io.encodings.ascii => ascii ; +FROM: ascii => ascii? ; IN: help.html : escape-char ( ch -- ) From 6257b97e4ceacee8c3a9acaebbd37f6f32b760fd Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Sat, 16 May 2009 16:54:45 -0500 Subject: [PATCH 4/6] In Farkup, image text is only parsed if given separate from the URL --- basis/farkup/farkup-tests.factor | 4 +++- basis/farkup/farkup.factor | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/basis/farkup/farkup-tests.factor b/basis/farkup/farkup-tests.factor index abee7194a2..7d9c900ec2 100644 --- a/basis/farkup/farkup-tests.factor +++ b/basis/farkup/farkup-tests.factor @@ -96,7 +96,7 @@ link-no-follow? off [ "
int main()
" ] [ "[c{int main()}]" convert-farkup ] unit-test -[ "

\"image:lol.jpg\"/

" ] [ "[[image:lol.jpg]]" convert-farkup ] unit-test +[ "

\"lol.jpg\"/

" ] [ "[[image:lol.jpg]]" convert-farkup ] unit-test [ "

\"teh

" ] [ "[[image:lol.jpg|teh lol]]" convert-farkup ] unit-test [ "

http://lol.com

" ] [ "[[http://lol.com]]" convert-farkup ] unit-test [ "

haha

" ] [ "[[http://lol.com|haha]]" convert-farkup ] unit-test @@ -207,3 +207,5 @@ link-no-follow? off [ convert-farkup drop t ] [ drop print f ] recover ] all? ] unit-test + +[ "

http://foo.com/~foo

" ] [ "[[http://foo.com/~foo]]" convert-farkup ] unit-test diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index c400457c0b..a008b1d049 100644 --- a/basis/farkup/farkup.factor +++ b/basis/farkup/farkup.factor @@ -70,11 +70,15 @@ DEFER: (parse-paragraph) { CHAR: % inline-code } } at ; +: or-simple-title ( url title/f quot: ( title -- title' ) -- url title' ) + [ "" like dup simple-link-title ] if* ; inline + : parse-link ( string -- paragraph-list ) rest-slice "]]" split1-slice [ "|" split1 - [ "" like dup simple-link-title ] unless* - [ "image:" ?head ] dip swap [ image boa ] [ parse-paragraph link boa ] if + [ "image:" ?head ] dip swap + [ [ ] or-simple-title image boa ] + [ [ parse-paragraph ] or-simple-title link boa ] if ] dip [ (parse-paragraph) cons ] [ 1list ] if* ; : ?first ( seq -- elt ) 0 swap ?nth ; From 61fab37425b97df5fe3939d2a334f4a61ead00ba Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 16 May 2009 16:57:58 -0500 Subject: [PATCH 5/6] Fix regression with see'ing gensyms --- basis/see/see-tests.factor | 4 +++- basis/see/see.factor | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/basis/see/see-tests.factor b/basis/see/see-tests.factor index 3f11ec987e..ba81bf5e2f 100644 --- a/basis/see/see-tests.factor +++ b/basis/see/see-tests.factor @@ -1,5 +1,5 @@ IN: see.tests -USING: see tools.test io.streams.string math ; +USING: see tools.test io.streams.string math words ; CONSTANT: test-const 10 [ "IN: see.tests\nCONSTANT: test-const 10 inline\n" ] @@ -9,3 +9,5 @@ ALIAS: test-alias + [ "USING: math ;\nIN: see.tests\nALIAS: test-alias + inline\n" ] [ [ \ test-alias see ] with-string-writer ] unit-test + +[ ] [ gensym see ] unit-test \ No newline at end of file diff --git a/basis/see/see.factor b/basis/see/see.factor index d2515a2e81..a8d78a68e4 100644 --- a/basis/see/see.factor +++ b/basis/see/see.factor @@ -44,7 +44,7 @@ M: word print-stack-effect? drop t ; > vocab pprinter-in set ; + vocabulary>> dup [ vocab ] when pprinter-in set ; : word-synopsis ( word -- ) { From b4afea0bfd9fceaee48a6cd43bb891c4f0ec2779 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 16 May 2009 16:58:11 -0500 Subject: [PATCH 6/6] math.primes.list: update for lists.lazy changes --- extra/math/primes/lists/lists-tests.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/math/primes/lists/lists-tests.factor b/extra/math/primes/lists/lists-tests.factor index 3bd7d70365..5af13415e4 100644 --- a/extra/math/primes/lists/lists-tests.factor +++ b/extra/math/primes/lists/lists-tests.factor @@ -1,4 +1,4 @@ -USING: lists.lazy math.primes.lists tools.test ; +USING: lists lists.lazy math.primes.lists tools.test ; { { 2 3 5 7 11 13 17 19 23 29 } } [ 10 lprimes ltake list>array ] unit-test { { 101 103 107 109 113 } } [ 5 100 lprimes-from ltake list>array ] unit-test