]> gitweb.factorcode.org Git - factor.git/commitdiff
Oops, quoting is actually needed by db.postgresql
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 21 Mar 2009 07:54:59 +0000 (02:54 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 21 Mar 2009 07:54:59 +0000 (02:54 -0500)
basis/mime/multipart/multipart.factor
basis/quoting/authors.txt [new file with mode: 0644]
basis/quoting/quoting.factor [new file with mode: 0644]

index 37d5e13129be5a1375f4321b646161c99dd1d640..0edfb05a3081da96ed583c0454792630a6be6cc7 100755 (executable)
@@ -3,7 +3,8 @@
 USING: multiline kernel sequences io splitting fry namespaces
 http.parsers hashtables assocs combinators ascii io.files.unique
 accessors io.encodings.binary io.files byte-arrays math
-io.streams.string combinators.short-circuit strings math.order ;
+io.streams.string combinators.short-circuit strings math.order
+quoting ;
 IN: mime.multipart
 
 CONSTANT: buffer-size 65536
@@ -75,18 +76,6 @@ ERROR: end-of-stream multipart ;
 : empty-name? ( string -- ? )
     { "''" "\"\"" "" f } member? ;
 
-: quote? ( ch -- ? ) "'\"" member? ;
-
-: quoted? ( str -- ? )
-    {
-        [ length 1 > ]
-        [ first quote? ]
-        [ [ first ] [ peek ] bi = ]
-    } 1&& ;
-
-: unquote ( str -- newstr )
-    dup quoted? [ but-last-slice rest-slice >string ] when ;
-
 : save-uploaded-file ( multipart -- )
     dup filename>> empty-name? [
         drop
diff --git a/basis/quoting/authors.txt b/basis/quoting/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/quoting/quoting.factor b/basis/quoting/quoting.factor
new file mode 100644 (file)
index 0000000..5b09347
--- /dev/null
@@ -0,0 +1,16 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: sequences math kernel strings combinators.short-circuit ;
+IN: quoting
+
+: quote? ( ch -- ? ) "'\"" member? ;
+
+: quoted? ( str -- ? )
+    {
+        [ length 1 > ]
+        [ first quote? ]
+        [ [ first ] [ peek ] bi = ]
+    } 1&& ;
+
+: unquote ( str -- newstr )
+    dup quoted? [ but-last-slice rest-slice >string ] when ;
\ No newline at end of file