Commit 5c24c6d8 authored by Julien Signoles's avatar Julien Signoles
Browse files

Merge branch 'fix/cmdline/multiple-map' into 'master'

[cmdline] Fixes multiple_map parameters when a key is not bound to a value.

See merge request frama-c/frama-c!2584
parents 6c35b749 cb710519
......@@ -17,6 +17,9 @@
Open Source Release <next-release>
##################################
- Kernel [2020/04/01] Report user errors when keys are not bound to a
value for command-line options that require pairs of key:value
as arguments. Such keys were silently ignored.
*! Kernel [2020/03/30] Reject labels at end of blocks.
- RTE [2020/03/30] Emits alarm on invalid pointers when option is on
- Eva [2020/03/30] Emits alarm on invalid pointers when option is on
......@@ -31,7 +34,7 @@ Open Source Release <next-release>
- Kernel [2020/03/20] Add option -cpp-extra-args-per-file
-* Kernel [2020/03/18] Fixes #@823 (-load-module/-load-script now accept
spaces in filename)
-* Kernel [2020/03/18] Fixes #@818 (term generated for downcast alarms)
-* Kernel [2020/03/18] Fixes #@818 (term generated for downcast alarms)
- Eva [2020/03/17] Supports the ACSL extended quantifiers \min and \max.
- Eva [2020/03/17] deprecate options -eva-*-domain in favor of
-eva-domains
......
......@@ -1577,31 +1577,37 @@ struct
Text in the value returned by full_split *)
assert false
in
let apply_to_previous_pairing k f =
let keys = k_of_singleton_string k in
let key = ref None in
let prev =
try
K.Set.iter
(fun k ->
key := Some k;
(* choose any previous value, whatever it is:
don't know which clear semantics one would like *)
try raise (Found (!find_ref k)) with Not_found -> ())
keys;
None
with Found v ->
Some v
in
match !key with
| None -> K.Set.empty, []
| Some key -> keys, f ~key ~prev
in
let get_pairing k v l =
apply_to_previous_pairing k (parse_values k [] v l)
in
fun s ->
let (keys, values) =
let get_pairing k v l =
let keys = k_of_singleton_string k in
let key = ref None in
let prev =
try
K.Set.iter
(fun k ->
key := Some k;
(* choose any previous value, whatever it is:
don't know which clear semantics one would like *)
try raise (Found (!find_ref k)) with Not_found -> ())
keys;
None
with Found v ->
Some v
in
match !key with
| None -> K.Set.empty, []
| Some key -> keys, parse_values ~key k ~prev [] v l
in
match Str.full_split r s with
| [] -> cannot_build ("cannot interpret '" ^ s ^ "'")
| [Str.Text t] -> k_of_singleton_string t, []
| [Str.Text t] ->
apply_to_previous_pairing t
(fun ~key ~prev ->
remove_none_and_rev [of_val ~key t ~prev None])
| Str.Delim d :: l ->
let (f,s) = split_delim d in
get_pairing f s l
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment