]> gitweb.factorcode.org Git - factor.git/commitdiff
uncomment unit tests and fix parser.state....
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 15 Mar 2009 18:27:36 +0000 (13:27 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 15 Mar 2009 18:27:36 +0000 (13:27 -0500)
extra/html/parser/state/state-tests.factor
extra/html/parser/state/state.factor

index a9be38c0b56e9cecb2dcbccad1ed489c10c75d24..da70d0fa12a22d017725b191df6cbf81d77921e9 100644 (file)
@@ -10,4 +10,5 @@ IN: html.parser.state.tests
 [ "hello" ] [ "hello" [ take-rest ] string-parse ] unit-test
 [ "hi" " how are you?" ] [ "hi how are you?" [ [ get-char blank? ] take-until take-rest ] string-parse ] unit-test
 [ "foo" ";bar" ] [ "foo;bar" [ CHAR: ; take-char take-rest ] string-parse ] unit-test
-! [ "foo " " bar" ] [ "foo and bar" [ "and" take-string take-rest ] string-parse ] unit-test
+[ "foo " " bar" ]
+[ "foo and bar" [ "and" take-string take-rest ] string-parse ] unit-test
index 4b1027d3385b94cbb9e139a262e605cca6b357f0..cda601866eb2a40b178e78985d8cbab7b302b88e 100644 (file)
@@ -29,13 +29,13 @@ TUPLE: state string i ;
     ] [ drop ] if ; inline recursive
 
 : take-until ( quot: ( -- ? ) -- )
-    [ get-i ] dip skip-until get-i
+    get-i [ skip-until ] dip get-i
     state get string>> subseq ;
 
 : string-matches? ( string circular -- ? )
-    get-char over push-circular sequence= ;
+    get-char over push-growing-circular sequence= ;
 
 : take-string ( match -- string )
-    dup length <circular-string>
+    dup length <growing-circular>
     [ 2dup string-matches? ] take-until nip
     dup length rot length 1- - head next ;