# HG changeset patch # User paulson # Date 914860102 -3600 # Node ID 01f67f5f8dd09ce99255d5ab1d40a940ae7ffd81 # Parent dfdb7584cf9676f151eff928b17ca6f988832a11 deleted "escape" and "trim"; Basis Library can do string escapes if necessary diff -r dfdb7584cf96 -r 01f67f5f8dd0 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;