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

db4
U-SLAVA-DFB8FF805\Slava 2008-07-07 19:34:41 -05:00
commit ad893fa2f5
8 changed files with 38 additions and 8 deletions

View File

@ -3,7 +3,7 @@ AR = ar
LD = ld
EXECUTABLE = factor
VERSION = 0.91
VERSION = 0.92
IMAGE = factor.image
BUNDLE = Factor.app

View File

@ -505,6 +505,8 @@ M: quotation '
jit-r>-word
jit-swap
jit-swap-word
jit-over
jit-over-word
jit-fixnum-fast
jit-fixnum-fast-word
jit-fixnum>=

View File

@ -11,7 +11,7 @@ HELP: column
HELP: <column> ( seq n -- column )
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "column" column } }
{ $description "Outputs a new virtual sequence which presents a fixed column of a matrix represented as a sequence of rows." "The " { $snippet "i" } "th element of a column is the " { $snippet "n" } "th element of the " { $snippet "i" } "th element of" { $snippet "seq" } ". Every element of " { $snippet "seq" } " must be a sequence, and all sequences must have equal length." }
{ $description "Outputs a new virtual sequence which presents a fixed column of a matrix represented as a sequence of rows." "The " { $snippet "i" } "th element of a column is the " { $snippet "n" } "th element of the " { $snippet "i" } "th element of " { $snippet "seq" } ". Every element of " { $snippet "seq" } " must be a sequence, and all sequences must have equal length." }
{ $examples
{ $example
"USING: arrays prettyprint columns ;"

View File

@ -5,6 +5,7 @@ ARTICLE: "ctags" "Ctags file"
{ $emphasis "ctags" } " generates a index file of every factor word in ctags format as supported by vi and other editors. More information can be found at " { $url "http://en.wikipedia.org/wiki/Ctags" } "."
{ $subsection ctags }
{ $subsection ctags-write }
{ $subsection ctag-strings }
{ $subsection ctag } ;
HELP: ctags ( path -- )
@ -19,9 +20,9 @@ HELP: ctags ( path -- )
} ;
HELP: ctags-write ( seq path -- )
{ $values { "seq" sequence }
{ $values { "alist" "an association list" }
{ "path" "a pathname string" } }
{ $description "Stores a " { $snippet "seq" } " in " { $snippet "path" } ". " { $snippet "seq" } " must be an association list with ctags format: key must be a valid word and value a sequence whose first element is a resource name and second element is a line number" }
{ $description "Stores a " { $snippet "alist" } " in " { $snippet "path" } ". " { $snippet "alist" } " must be an association list with ctags format: key must be a valid word and value a sequence whose first element is a resource name and second element is a line number" }
{ $examples
{ $example
"USING: kernel ctags ;"
@ -32,6 +33,18 @@ HELP: ctags-write ( seq path -- )
{ $notes
{ $snippet "tags" } " file will contain a single line: if\\t/path/to/factor/extra/unix/unix.factor\\t91" } ;
HELP: ctag-strings ( alist -- seq )
{ $values { "alist" "an association list" }
{ "seq" sequence } }
{ $description "Converts an " { $snippet "alist" } " with ctag format (a word as key and a sequence whose first element is a resource name and a second element is a line number as value) in a " { $snippet "seq" } " of ctag strings." }
{ $examples
{ $example
"USING: kernel ctags ;"
"{ { if { \"resource:extra/unix/unix.factor\" 91 } } } ctag-strings"
"{ \"if\\t/path/to/factor/extra/unix/unix.factor\\t91\" }"
}
} ;
HELP: ctag ( seq -- str )
{ $values { "seq" sequence }
{ "str" string } }

View File

@ -1,7 +1,12 @@
USING: kernel ctags tools.test io.backend sequences ;
IN: columns.tests
USING: kernel ctags tools.test io.backend sequences arrays prettyprint ;
IN: ctags.tests
[ t ] [
"if\t" "resource:extra/unix/unix.factor" normalize-path "\t91" 3append
{ if { "resource:extra/unix/unix.factor" 91 } } ctag =
] unit-test
[ t ] [
"if\t" "resource:extra/unix/unix.factor" normalize-path "\t91" 3append 1array
{ { if { "resource:extra/unix/unix.factor" 91 } } } ctag-strings =
] unit-test

View File

@ -18,8 +18,11 @@ IN: ctags
second number>string %
] "" make ;
: ctag-strings ( seq1 -- seq2 )
{ } swap [ ctag suffix ] each ;
: ctags-write ( seq path -- )
ascii [ [ ctag print ] each ] with-file-writer ;
>r ctag-strings r> ascii set-file-lines ;
: (ctags) ( -- seq )
{ } all-words [

View File

@ -1,7 +1,7 @@
USING: tools.walker io io.streams.string kernel math
math.private namespaces prettyprint sequences tools.test
continuations math.parser threads arrays tools.walker.debug
generic.standard ;
generic.standard sequences.private kernel.private ;
IN: tools.walker.tests
[ { } ] [
@ -50,6 +50,10 @@ IN: tools.walker.tests
[ 5 6 number= ] test-walker
] unit-test
[ { 0 } ] [
[ 0 { array-capacity } declare ] test-walker
] unit-test
[ { f } ] [
[ "XYZ" "XYZ" mismatch ] test-walker
] unit-test

View File

@ -422,7 +422,10 @@ F_FIXNUM quot_code_offset_to_scan(CELL quot, F_FIXNUM offset)
}
if(jit_ignore_declare_p(untag_object(array),i))
{
if(offset == 0) return i;
i++;
break;
}
default: