diff options
| author | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2012-01-08 15:38:38 +0000 |
|---|---|---|
| committer | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2012-01-08 15:38:38 +0000 |
| commit | d02419cef712af9cc580b7aadfebacfa75901ec4 (patch) | |
| tree | e7754cc5d6ee8772cf0cd5b091d81a2ebee76f45 /stdlib/scanf.ml | |
| parent | 288ebd8cbcf201c42cc865a1cadb93292ddad59f (diff) | |
| download | ocaml-d02419cef712af9cc580b7aadfebacfa75901ec4.tar.gz | |
Fix bug #3888 (String.map and Scanf.unescaped)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12004 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/scanf.ml')
| -rw-r--r-- | stdlib/scanf.ml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/stdlib/scanf.ml b/stdlib/scanf.ml index 11abe0212e..2bfd45cc6c 100644 --- a/stdlib/scanf.ml +++ b/stdlib/scanf.ml @@ -1488,7 +1488,8 @@ let bscanf ib = kscanf ib scanf_bad_input;; let fscanf ic = bscanf (Scanning.from_channel ic);; -let sscanf s = bscanf (Scanning.from_string s);; +let sscanf : string -> ('a, 'b, 'c, 'd) scanner + = fun s -> bscanf (Scanning.from_string s);; let scanf fmt = bscanf Scanning.stdib fmt;; @@ -1521,6 +1522,9 @@ let format_from_string s fmt = sscanf_format (string_to_String s) fmt (fun x -> x) ;; +let unescaped s = + sscanf ("\"" ^ s ^ "\"") "%S%!" (fun x -> x) + (* Local Variables: compile-command: "cd ..; make world" |
