Fixing libraries for language changes
parent
a1a8a39c34
commit
1997cbe9aa
|
@ -87,7 +87,7 @@ M: threaded-server handle-client* handler>> call ;
|
|||
[ [ accept-connection ] with-semaphore ]
|
||||
[ accept-connection ]
|
||||
if*
|
||||
] [ accept-loop ] bi ; inline
|
||||
] [ accept-loop ] bi ; inline recursive
|
||||
|
||||
: started-accept-loop ( server -- )
|
||||
threaded-server get
|
||||
|
|
|
@ -27,7 +27,7 @@ IN: xml.generator
|
|||
|
||||
! Word-based XML literal syntax
|
||||
: parsed-name ( accum -- accum )
|
||||
scan ":" split1 [ f <name> ] [ <name-tag> ] if* parsed ;
|
||||
scan ":" split1 [ f <name> ] [ <simple-name> ] if* parsed ;
|
||||
|
||||
: run-combinator ( accum quot1 quot2 -- accum )
|
||||
>r [ ] like parsed r> [ parsed ] each ;
|
||||
|
|
|
@ -127,17 +127,17 @@ TUPLE: pull-xml scope ;
|
|||
: call-under ( quot object -- quot )
|
||||
swap dup slip ; inline
|
||||
|
||||
: sax-loop ( quot -- ) ! quot: xml-elem --
|
||||
: sax-loop ( quot: ( xml-elem -- ) -- )
|
||||
parse-text call-under
|
||||
get-char [ make-tag call-under sax-loop ]
|
||||
[ drop ] if ; inline
|
||||
[ drop ] if ; inline recursive
|
||||
|
||||
: sax ( stream quot -- ) ! quot: xml-elem --
|
||||
: sax ( stream quot: ( xml-elem -- ) -- )
|
||||
swap [
|
||||
reset-prolog init-ns-stack
|
||||
prolog-data get call-under
|
||||
sax-loop
|
||||
] state-parse ; inline
|
||||
] state-parse ; inline recursive
|
||||
|
||||
: (read-xml) ( -- )
|
||||
[ process ] sax-loop ; inline
|
||||
|
|
|
@ -31,10 +31,10 @@ SYMBOL: matrix
|
|||
>r over r> nth dup zero? [
|
||||
3drop 0
|
||||
] [
|
||||
>r nth dup zero? [
|
||||
r> 2drop 0
|
||||
>r nth dup zero? r> swap [
|
||||
2drop 0
|
||||
] [
|
||||
r> swap / neg
|
||||
swap / neg
|
||||
] if
|
||||
] if ;
|
||||
|
||||
|
|
|
@ -76,8 +76,8 @@ TUPLE: entry title url description date ;
|
|||
[ "link" tag-named "href" swap at >url >>url ]
|
||||
[
|
||||
{ "content" "summary" } any-tag-named
|
||||
dup tag-children [ string? not ] contains?
|
||||
[ tag-children [ write-chunk ] with-string-writer ]
|
||||
dup children>> [ string? not ] contains?
|
||||
[ children>> [ write-chunk ] with-string-writer ]
|
||||
[ children>string ] if >>description
|
||||
]
|
||||
[
|
||||
|
@ -96,7 +96,7 @@ TUPLE: entry title url description date ;
|
|||
tri ;
|
||||
|
||||
: xml>feed ( xml -- feed )
|
||||
dup name-tag {
|
||||
dup main>> {
|
||||
{ "RDF" [ rss1.0 ] }
|
||||
{ "rss" [ rss2.0 ] }
|
||||
{ "feed" [ atom1.0 ] }
|
||||
|
|
Loading…
Reference in New Issue