]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge quoting vocab into mime.multipart
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 21 Mar 2009 00:43:06 +0000 (19:43 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 21 Mar 2009 00:43:06 +0000 (19:43 -0500)
basis/mime/multipart/multipart.factor
basis/quoting/authors.txt [deleted file]
basis/quoting/quoting-docs.factor [deleted file]
basis/quoting/quoting-tests.factor [deleted file]
basis/quoting/quoting.factor [deleted file]

index 0edfb05a3081da96ed583c0454792630a6be6cc7..7f9c979f40134ba2126426cc3751acde48dc1fc2 100755 (executable)
@@ -76,6 +76,18 @@ 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
deleted file mode 100644 (file)
index 7c1b2f2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Doug Coleman
diff --git a/basis/quoting/quoting-docs.factor b/basis/quoting/quoting-docs.factor
deleted file mode 100644 (file)
index 5fb68db..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-! Copyright (C) 2009 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax strings ;
-IN: quoting
-
-HELP: quote?
-{ $values
-     { "ch" "a character" }
-     { "?" "a boolean" }
-}
-{ $description "Returns true if the character is a single or double quote." } ;
-
-HELP: quoted?
-{ $values
-     { "str" string }
-     { "?" "a boolean" }
-}
-{ $description "Returns true if a string is surrounded by matching single or double quotes as the first and last characters." } ;
-
-HELP: unquote
-{ $values
-     { "str" string }
-     { "newstr" string }
-}
-{ $description "Removes a pair of matching single or double quotes from a string." } ;
-
-ARTICLE: "quoting" "Quotation marks"
-"The " { $vocab-link "quoting" } " vocabulary is for removing quotes from a string." $nl
-"Removing quotes:"
-{ $subsection unquote } ;
-
-ABOUT: "quoting"
diff --git a/basis/quoting/quoting-tests.factor b/basis/quoting/quoting-tests.factor
deleted file mode 100644 (file)
index 0cc28a1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-! Copyright (C) 2009 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: tools.test quoting ;
-IN: quoting.tests
-
-
-[ "abc" ] [ "'abc'" unquote ] unit-test
-[ "abc" ] [ "\"abc\"" unquote ] unit-test
-[ "'abc" ] [ "'abc" unquote ] unit-test
-[ "abc'" ] [ "abc'" unquote ] unit-test
diff --git a/basis/quoting/quoting.factor b/basis/quoting/quoting.factor
deleted file mode 100644 (file)
index 9e25037..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-! Copyright (C) 2009 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: combinators.short-circuit kernel math sequences strings ;
-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 ;