deleted "escape" and "trim"; Basis Library can do string escapes if necessary
authorpaulson
Mon, 28 Dec 1998 16:48:22 +0100
changeset 6039 01f67f5f8dd0
parent 6038 dfdb7584cf96
child 6040 bd37dc0f56d9
deleted "escape" and "trim"; Basis Library can do string escapes if necessary
src/Pure/section_utils.ML
--- a/src/Pure/section_utils.ML	Mon Dec 28 16:47:47 1998 +0100
+++ b/src/Pure/section_utils.ML	Mon Dec 28 16:48:22 1998 +0100
@@ -40,21 +40,3 @@
     |> #1;
 
 fun is_backslash c = c = "\\";
-
-(*Apply string escapes to a quoted string; see Def of Standard ML, page 3
-  Does not handle the \ddd form;  no error checking*)
-fun escape [] = []
-  | escape cs = (case take_prefix (not o is_backslash) cs of
-	 (front, []) => front
-       | (front, _::"n"::rest) => front @ ("\n" :: escape rest)
-       | (front, _::"t"::rest) => front @ ("\t" :: escape rest)
-       | (front, _::"^"::c::rest) => front @ (chr(ord(c)-64) :: escape rest)
-       | (front, _::"\""::rest) => front @ ("\"" :: escape rest)
-       | (front, _::"\\"::rest) => front @ ("\\" :: escape rest)
-       | (front, b::c::rest) => 
-	   if Symbol.is_blank c   (*remove any further blanks and the following \ *)
-	   then front @ escape (tl (snd (take_prefix Symbol.is_blank rest)))
-	   else error ("Unrecognized string escape: " ^ implode(b::c::rest)));
-
-(*Remove the first and last charaters -- presumed to be quotes*)
-val trim = implode o escape o rev o tl o rev o tl o Symbol.explode;