]> gitweb.factorcode.org Git - factor.git/commitdiff
more cleanup
authorDoug Coleman <erg@jobim.local>
Wed, 1 Apr 2009 16:48:44 +0000 (11:48 -0500)
committerDoug Coleman <erg@jobim.local>
Wed, 1 Apr 2009 16:48:44 +0000 (11:48 -0500)
extra/html/parser/parser.factor

index 63efa3fdb2fab2bb418c3d79426f6ee7a9a79e3b..6d2e02cf1d86825c4fe9c7985fa1d5f4a9c7aba9 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors arrays hashtables html.parser.state
 html.parser.utils kernel namespaces sequences
 unicode.case unicode.categories combinators.short-circuit
-quoting ;
+quoting fry ;
 IN: html.parser
 
 
@@ -19,7 +19,7 @@ SYMBOL: tagstack
 
 : closing-tag? ( string -- ? )
     [ f ]
-    [ [ first ] [ peek ] bi [ CHAR: / = ] bi@ or ] if-empty ;
+    [ { [ first CHAR: / = ] [ peek CHAR: / = ] } 1|| ] if-empty ;
 
 : <tag> ( name attributes closing? -- tag )
     tag new
@@ -35,11 +35,14 @@ SYMBOL: tagstack
         swap >>name
         swap >>text ; inline
 
+: (read-quote) ( state-parser ch -- string )
+    '[ [ current _ = ] take-until ] [ next drop ] bi ;
+
 : read-single-quote ( state-parser -- string )
-    [ [ current CHAR: ' = ] take-until ] [ next drop ] bi ;
+    CHAR: ' (read-quote) ;
 
 : read-double-quote ( state-parser -- string )
-    [ [ current CHAR: " = ] take-until ] [ next drop ] bi ;
+    CHAR: " (read-quote) ;
 
 : read-quote ( state-parser -- string )
     dup get+increment CHAR: ' =