]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 6 Mar 2008 23:12:15 +0000 (17:12 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 6 Mar 2008 23:12:15 +0000 (17:12 -0600)
Conflicts:

extra/html/parser/analyzer/analyzer.factor

1  2 
extra/html/parser/analyzer/analyzer.factor

index 511730efb4be05f91a0bfd2a9f8f4f7afc217990,8fc45ec486590d441a11d16c3d94b7aa548613f8..45197b1a909e26de336b31e3576f5cee2a063fc8
@@@ -1,50 -1,7 +1,43 @@@
  USING: assocs html.parser kernel math sequences strings ascii
- arrays shuffle unicode.case namespaces splitting
- http.server.responders sequences.lib ;
+ arrays shuffle unicode.case namespaces splitting http ;
  IN: html.parser.analyzer
  
- : multi-find* ( n seq quots -- i elt )
-     ;
- : multi-find ( seq quots -- i elt )
-     0 -rot ;
 +: (find-relative)
 +    [ >r + dup r> ?nth* [ 2drop f f ] unless ] [ 2drop f ] if ;
 +
 +: find-relative ( seq quot n -- i elt )
 +    >r over [ find drop ] dip r> swap pick
 +    (find-relative) ;
 +
 +: (find-all) ( n seq quot -- )
 +    2dup >r >r find* [
 +        dupd 2array , 1+ r> r> (find-all)
 +    ] [
 +        r> r> 3drop
 +    ] if* ;
 +
 +: find-all ( seq quot -- alist )
 +    [ 0 -rot (find-all) ] { } make ;
 +
 +: (find-nth) ( offset seq quot n count -- obj )
 +    >r >r [ find* ] 2keep 4 npick [
 +        r> r> 1+ 2dup <= [
 +            4drop
 +        ] [
 +            >r >r >r >r drop 1+ r> r> r> r>
 +            (find-nth)
 +        ] if
 +    ] [
 +        2drop r> r> 2drop
 +    ] if ;
 +
 +: find-nth ( seq quot n -- i elt )
 +    0 -roll 0 (find-nth) ;
 +
 +: find-nth-relative ( seq quot n offest -- i elt )
 +    >r [ find-nth ] 3keep 2drop nip r> swap pick
 +    (find-relative) ;
 +
  : remove-blank-text ( vector -- vector' )
      [
          dup tag-name text = [