summaryrefslogtreecommitdiffstats
path: root/stdlib/camlinternalFormat.ml
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/camlinternalFormat.ml')
-rw-r--r--stdlib/camlinternalFormat.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/stdlib/camlinternalFormat.ml b/stdlib/camlinternalFormat.ml
index 9ddcf748d..81bd9f1a8 100644
--- a/stdlib/camlinternalFormat.ml
+++ b/stdlib/camlinternalFormat.ml
@@ -1666,7 +1666,12 @@ let fmt_ebb_of_string str =
as ignoring it would typically result in a different typing
than what the legacy parser used *)
if not !ign_used && ign then
- incompatible_flag pct_ind str_ind symb "'_'";
+ begin match symb with
+ (* argument-less formats can safely be ignored in legacy mode *)
+ | ('@' | '%' | '!' | ',') when legacy_behavior -> ()
+ | _ ->
+ incompatible_flag pct_ind str_ind symb "'_'"
+ end;
fmt_result
(* Parse formatting informations (after '@'). *)