printf behavior of %{..%}
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14833 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
7f8e43aa9a
commit
2da1602532
|
@ -978,10 +978,12 @@ fun k o acc fmt -> match fmt with
|
|||
| Char_literal (chr, rest) ->
|
||||
make_printf k o (Acc_char (acc, chr)) rest
|
||||
|
||||
| Format_arg (_, _, rest) ->
|
||||
(* Use the following code to obtain the old (curious?) semantics. *)
|
||||
(*fun _ -> make_printf k o (Acc_string (acc, string_of_fmtty fmtty)) rest*)
|
||||
fun (_, str) -> make_printf k o (Acc_string (acc, str)) rest
|
||||
| Format_arg (_, sub_fmtty, rest) ->
|
||||
if legacy_behavior then
|
||||
let ty = string_of_fmtty sub_fmtty in
|
||||
(fun _str ->
|
||||
make_printf k o (Acc_string (acc, ty)) rest)
|
||||
else (fun (_, str) -> make_printf k o (Acc_string (acc, str)) rest)
|
||||
| Format_subst (_, _, fmtty, rest) ->
|
||||
(* Call to type_format can't fail (raise Type_mismatch). *)
|
||||
fun (fmt, _) -> make_printf k o acc
|
||||
|
|
Loading…
Reference in New Issue