Merge commit 'factor/master'

db4
Eduardo Cavazos 2008-11-17 21:58:15 -06:00
commit 4489de250f
18 changed files with 32 additions and 16 deletions

View File

@ -346,7 +346,6 @@ M:: sequence method-with-locals ( a -- y ) a reverse ;
{ 3 1 } [| from to seq | T{ slice f from to seq } ] must-infer-as
:: literal-identity-test ( -- a b )
{ } V{ } ;
@ -356,6 +355,10 @@ M:: sequence method-with-locals ( a -- y ) a reverse ;
swapd [ eq? ] [ eq? ] 2bi*
] unit-test
:: mutable-local-in-literal-test ( a! -- b ) a 1 + a! { a } ;
[ { 4 } ] [ 3 mutable-local-in-literal-test ] unit-test
:: compare-case ( obj1 obj2 lt-quot eq-quot gt-quot -- )
obj1 obj2 <=> {
{ +lt+ [ lt-quot call ] }

View File

@ -137,7 +137,7 @@ ERROR: bad-special-group string ;
DEFER: (parse-regexp)
: nested-parse-regexp ( token ? -- )
[ push-stack (parse-regexp) pop-stack ] dip
[ <negation> ] when pop-stack boa push-stack ;
[ <negation> ] when pop-stack new swap >>term push-stack ;
! non-capturing groups
: (parse-special-group) ( -- )

View File

@ -2,6 +2,9 @@ USING: regexp tools.test kernel sequences regexp.parser
regexp.traversal eval ;
IN: regexp-tests
\ <regexp> must-infer
\ matches? must-infer
[ f ] [ "b" "a*" <regexp> matches? ] unit-test
[ t ] [ "" "a*" <regexp> matches? ] unit-test
[ t ] [ "a" "a*" <regexp> matches? ] unit-test

View File

@ -107,7 +107,8 @@ M: capture-group-off flag-action ( dfa-traverser flag -- )
: increment-state ( dfa-traverser state -- dfa-traverser )
[
dup traverse-forward>>
[ 1+ ] [ 1- ] ? change-current-index
[ [ 1+ ] change-current-index ]
[ [ 1- ] change-current-index ] if
dup current-state>> >>last-state
] dip
first >>current-state ;

View File

@ -0,0 +1,4 @@
USING: regexp.utils tools.test ;
IN: regexp.utils.tests
[ [ ] [ ] while-changes ] must-infer

View File

@ -5,9 +5,7 @@ namespaces regexp.backend sequences unicode.categories
math.ranges fry combinators.short-circuit vectors ;
IN: regexp.utils
: (while-changes) ( obj quot pred pred-ret -- obj )
! quot: ( obj -- obj' )
! pred: ( obj -- <=> )
: (while-changes) ( obj quot: ( obj -- obj' ) pred: ( obj -- <=> ) pred-ret -- obj )
[ [ dup slip ] dip pick over call ] dip dupd =
[ 3drop ] [ (while-changes) ] if ; inline recursive

View File

@ -4,7 +4,7 @@ IN: benchmark.regex-dna.tests
[ t ] [
"resource:extra/benchmark/regex-dna/regex-dna-test-in.txt"
[ regex-dna ] with-string-writer string-lines
[ regex-dna ] with-string-writer <string-reader> lines
"resource:extra/benchmark/regex-dna/regex-dna-test-out.txt"
ascii file-lines =
] unit-test

View File

@ -0,0 +1 @@
Slava Pestov

View File

@ -0,0 +1 @@
Slides from a talk at Galois by Slava Pestov, October 2008

View File

@ -0,0 +1 @@
demos

View File

@ -0,0 +1 @@
Slava Pestov

View File

@ -0,0 +1 @@
Slides from Google Tech Talk by Slava Pestov, October 2008

View File

@ -0,0 +1 @@
demos

View File

@ -18,7 +18,7 @@ IN: hardware-info.windows
: processor-architecture ( -- n )
system-info SYSTEM_INFO-dwOemId HEX: ffff0000 bitand ;
: os-version
: os-version ( -- os-version )
"OSVERSIONINFO" <c-object>
"OSVERSIONINFO" heap-size over set-OSVERSIONINFO-dwOSVersionInfoSize
[ GetVersionEx ] keep swap zero? [ win32-error ] when ;
@ -67,4 +67,4 @@ IN: hardware-info.windows
{
{ [ os wince? ] [ "hardware-info.windows.ce" ] }
{ [ os winnt? ] [ "hardware-info.windows.nt" ] }
} cond [ require ] when* >>
} cond require >>

View File

@ -48,19 +48,17 @@ IN: slides
: $divider ( -- )
[
<gadget>
T{ gradient f
{
T{ rgba f 0.25 0.25 0.25 1.0 }
T{ rgba f 1.0 1.0 1.0 0.0 }
}
} >>interior
{
T{ rgba f 0.25 0.25 0.25 1.0 }
T{ rgba f 1.0 1.0 1.0 0.0 }
} <gradient> >>interior
{ 800 10 } >>dim
{ 1 0 } >>orientation
gadget.
] ($block) ;
: page-theme ( gadget -- )
T{ gradient f { T{ rgba f 0.8 0.8 1.0 1.0 } T{ rgba f 0.8 1.0 1.0 1.0 } } }
{ T{ rgba f 0.8 0.8 1.0 1.0 } T{ rgba f 0.8 1.0 1.0 1.0 } } <gradient>
>>interior drop ;
: <page> ( list -- gadget )

View File

@ -0,0 +1 @@
Slava Pestov

View File

@ -0,0 +1 @@
Slides from a talk at VPRI by Slava Pestov, October 2008

1
extra/vpri-talk/tags.txt Normal file
View File

@ -0,0 +1 @@
demos