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

db4
Doug Coleman 2009-05-17 18:00:24 -05:00
commit daeb25175b
9 changed files with 25 additions and 43 deletions

View File

@ -96,7 +96,7 @@ link-no-follow? off
[ "<pre><span class=\"KEYWORD3\">int</span> <span class=\"FUNCTION\">main</span><span class=\"OPERATOR\">(</span><span class=\"OPERATOR\">)</span></pre>" ] [ "<pre><span class=\"KEYWORD3\">int</span> <span class=\"FUNCTION\">main</span><span class=\"OPERATOR\">(</span><span class=\"OPERATOR\">)</span></pre>" ]
[ "[c{int main()}]" convert-farkup ] unit-test [ "[c{int main()}]" convert-farkup ] unit-test
[ "<p><img src=\"lol.jpg\" alt=\"image:lol.jpg\"/></p>" ] [ "[[image:lol.jpg]]" convert-farkup ] unit-test [ "<p><img src=\"lol.jpg\" alt=\"lol.jpg\"/></p>" ] [ "[[image:lol.jpg]]" convert-farkup ] unit-test
[ "<p><img src=\"lol.jpg\" alt=\"teh lol\"/></p>" ] [ "[[image:lol.jpg|teh lol]]" convert-farkup ] unit-test [ "<p><img src=\"lol.jpg\" alt=\"teh lol\"/></p>" ] [ "[[image:lol.jpg|teh lol]]" convert-farkup ] unit-test
[ "<p><a href=\"http://lol.com\">http://lol.com</a></p>" ] [ "[[http://lol.com]]" convert-farkup ] unit-test [ "<p><a href=\"http://lol.com\">http://lol.com</a></p>" ] [ "[[http://lol.com]]" convert-farkup ] unit-test
[ "<p><a href=\"http://lol.com\">haha</a></p>" ] [ "[[http://lol.com|haha]]" convert-farkup ] unit-test [ "<p><a href=\"http://lol.com\">haha</a></p>" ] [ "[[http://lol.com|haha]]" convert-farkup ] unit-test
@ -207,3 +207,5 @@ link-no-follow? off
[ convert-farkup drop t ] [ drop print f ] recover [ convert-farkup drop t ] [ drop print f ] recover
] all? ] all?
] unit-test ] unit-test
[ "<p><a href=\"http://foo.com/~foo\">http://foo.com/~foo</a></p>" ] [ "[[http://foo.com/~foo]]" convert-farkup ] unit-test

View File

@ -70,11 +70,15 @@ DEFER: (parse-paragraph)
{ CHAR: % inline-code } { CHAR: % inline-code }
} at ; } at ;
: or-simple-title ( url title/f quot: ( title -- title' ) -- url title' )
[ "" like dup simple-link-title ] if* ; inline
: parse-link ( string -- paragraph-list ) : parse-link ( string -- paragraph-list )
rest-slice "]]" split1-slice [ rest-slice "]]" split1-slice [
"|" split1 "|" split1
[ "" like dup simple-link-title ] unless* [ "image:" ?head ] dip swap
[ "image:" ?head ] dip swap [ image boa ] [ parse-paragraph link boa ] if [ [ ] or-simple-title image boa ]
[ [ parse-paragraph ] or-simple-title link boa ] if
] dip [ (parse-paragraph) cons ] [ 1list ] if* ; ] dip [ (parse-paragraph) cons ] [ 1list ] if* ;
: ?first ( seq -- elt ) 0 swap ?nth ; : ?first ( seq -- elt ) 0 swap ?nth ;

View File

@ -2,3 +2,5 @@ IN: help.html.tests
USING: help.html tools.test help.topics kernel ; USING: help.html tools.test help.topics kernel ;
[ ] [ "xml" >link help>html drop ] unit-test [ ] [ "xml" >link help>html drop ] unit-test
[ "article-foobar.html" ] [ "foobar" >link topic>filename ] unit-test

View File

@ -1,11 +1,13 @@
! Copyright (C) 2008, 2009 Slava Pestov. ! Copyright (C) 2008, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! 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 io.files io.files.temp io.directories html.streams help kernel
assocs sequences make words accessors arrays help.topics vocabs assocs sequences make words accessors arrays help.topics vocabs
vocabs.hierarchy help.vocabs namespaces prettyprint io vocabs.hierarchy help.vocabs namespaces prettyprint io
vocabs.loader serialize fry memoize unicode.case math.order vocabs.loader serialize fry memoize unicode.case math.order
sorting debugger html xml.syntax xml.writer math.parser ; sorting debugger html xml.syntax xml.writer math.parser ;
FROM: io.encodings.ascii => ascii ;
FROM: ascii => ascii? ;
IN: help.html IN: help.html
: escape-char ( ch -- ) : escape-char ( ch -- )

View File

@ -1,5 +1,5 @@
IN: see.tests IN: see.tests
USING: see tools.test io.streams.string math ; USING: see tools.test io.streams.string math words ;
CONSTANT: test-const 10 CONSTANT: test-const 10
[ "IN: see.tests\nCONSTANT: test-const 10 inline\n" ] [ "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" ] [ "USING: math ;\nIN: see.tests\nALIAS: test-alias + inline\n" ]
[ [ \ test-alias see ] with-string-writer ] unit-test [ [ \ test-alias see ] with-string-writer ] unit-test
[ ] [ gensym see ] unit-test

View File

@ -44,7 +44,7 @@ M: word print-stack-effect? drop t ;
<PRIVATE <PRIVATE
: seeing-word ( word -- ) : seeing-word ( word -- )
vocabulary>> vocab pprinter-in set ; vocabulary>> dup [ vocab ] when pprinter-in set ;
: word-synopsis ( word -- ) : word-synopsis ( word -- )
{ {

View File

@ -1,12 +1,12 @@
! Copyright (C) 2007, 2009 Slava Pestov. ! Copyright (C) 2007, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: arrays accessors io.backend io.streams.c init fry namespaces USING: arrays accessors io.backend io.streams.c init fry namespaces
math make assocs kernel parser lexer strings.parser vocabs sequences math make assocs kernel parser parser.notes lexer strings.parser
sequences.private words memory kernel.private continuations io vocabs sequences sequences.private words memory kernel.private
vocabs.loader system strings sets vectors quotations byte-arrays continuations io vocabs.loader system strings sets vectors quotations
sorting compiler.units definitions generic generic.standard byte-arrays sorting compiler.units definitions generic
generic.single tools.deploy.config combinators classes generic.standard generic.single tools.deploy.config combinators
slots.private ; classes slots.private ;
QUALIFIED: bootstrap.stage2 QUALIFIED: bootstrap.stage2
QUALIFIED: command-line QUALIFIED: command-line
QUALIFIED: compiler.errors QUALIFIED: compiler.errors

View File

@ -6,33 +6,3 @@ cell-bits {
{ 64 [ "unix.stat.netbsd.64" require ] } { 64 [ "unix.stat.netbsd.64" require ] }
} case } 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 ) ;

View File

@ -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 { { 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 { { 101 103 107 109 113 } } [ 5 100 lprimes-from ltake list>array ] unit-test