fix some sets:members.
parent
a1c4678a98
commit
3ea9f09f6a
|
@ -1,14 +1,13 @@
|
|||
USING: accessors compiler.cfg compiler.cfg.loop-detection
|
||||
compiler.cfg.loop-detection.private compiler.cfg.debugger
|
||||
compiler.cfg.predecessors compiler.cfg.utilities tools.test dlists kernel
|
||||
namespaces sequences ;
|
||||
USING: accessors compiler.cfg.debugger
|
||||
compiler.cfg.loop-detection compiler.cfg.loop-detection.private
|
||||
compiler.cfg.utilities kernel namespaces sequences sets
|
||||
tools.test ;
|
||||
IN: compiler.cfg.loop-detection.tests
|
||||
QUALIFIED: sets
|
||||
|
||||
{ V{ 0 } { 1 } } [
|
||||
V{ } 0 insns>block V{ } 1 insns>block [ connect-bbs ] keep
|
||||
f f <natural-loop> [ process-loop-block ] keep
|
||||
blocks>> sets:members
|
||||
blocks>> members
|
||||
[ [ number>> ] map ] bi@
|
||||
] unit-test
|
||||
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
USING: accessors arrays assocs combinators compiler.cfg.dataflow-analysis
|
||||
compiler.cfg.instructions compiler.cfg.linearization compiler.cfg.stacks.local
|
||||
compiler.cfg.registers fry kernel math math.order namespaces sequences ;
|
||||
QUALIFIED: sets
|
||||
USING: accessors arrays assocs compiler.cfg.dataflow-analysis
|
||||
compiler.cfg.instructions compiler.cfg.linearization
|
||||
compiler.cfg.stacks.local fry kernel math math.order namespaces
|
||||
sequences sets ;
|
||||
FROM: namespaces => set ;
|
||||
IN: compiler.cfg.stacks.map
|
||||
|
||||
! Operations on the stack info
|
||||
: register-write ( n stack -- stack' )
|
||||
first2 rot suffix sets:members 2array ;
|
||||
first2 rot suffix members 2array ;
|
||||
|
||||
: adjust-stack ( n stack -- stack' )
|
||||
first2 pick '[ _ + ] map [ + ] dip 2array ;
|
||||
|
||||
: stack>vacant ( stack -- seq )
|
||||
first2 [ 0 max iota ] dip sets:diff ;
|
||||
first2 [ 0 max iota ] dip diff ;
|
||||
|
||||
: classify-read ( stack n -- val )
|
||||
swap 2dup second member? [ 2drop 0 ] [ first >= [ 1 ] [ 2 ] if ] if ;
|
||||
|
|
|
@ -383,7 +383,7 @@ PRIVATE>
|
|||
<PRIVATE
|
||||
|
||||
: ((each)) ( seq -- n quot )
|
||||
[ length check-length ] keep [ nth-unsafe ] curry ; inline
|
||||
[ length ] keep [ nth-unsafe ] curry ; inline
|
||||
|
||||
: (each) ( seq quot -- n quot' )
|
||||
[ ((each)) ] dip compose ; inline
|
||||
|
@ -404,7 +404,7 @@ PRIVATE>
|
|||
[ nth-unsafe ] bi-curry@ bi ; inline
|
||||
|
||||
: ((2each)) ( seq1 seq2 -- n quot )
|
||||
[ min-length check-length ] 2keep [ 2nth-unsafe ] 2curry ; inline
|
||||
[ min-length ] 2keep [ 2nth-unsafe ] 2curry ; inline
|
||||
|
||||
: (2each) ( seq1 seq2 quot -- n quot' )
|
||||
[ ((2each)) ] dip compose ; inline
|
||||
|
@ -414,7 +414,7 @@ PRIVATE>
|
|||
|
||||
: (3each) ( seq1 seq2 seq3 quot -- n quot' )
|
||||
[
|
||||
[ [ length ] tri@ min min check-length ]
|
||||
[ [ length ] tri@ min min ]
|
||||
[ [ 3nth-unsafe ] 3curry ] 3bi
|
||||
] dip compose ; inline
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
USING: arrays combinators.short-circuit combinators.smart
|
||||
io.directories io.pathnames kernel math math.parser sequences
|
||||
sorting sorting.human splitting ;
|
||||
QUALIFIED: sets
|
||||
IN: forestdb.paths
|
||||
|
||||
CONSTANT: fdb-filename-base "fq"
|
||||
|
@ -71,7 +70,7 @@ ERROR: not-a-string-number string ;
|
|||
[ [ fdb-filename? ] filter length ] bi = ;
|
||||
|
||||
: path-fdb-duplicates ( path -- seq )
|
||||
directory-files [ canonical-fdb-name ] map sets:members ;
|
||||
directory-files [ canonical-fdb-name ] map members ;
|
||||
|
||||
: ensure-fdb-directory ( filename -- filename )
|
||||
[ make-directories ] keep ;
|
||||
|
|
Loading…
Reference in New Issue