aboutsummaryrefslogtreecommitdiffhomepage
path: root/parsing/g_vernac.ml4
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2016-11-02 15:57:19 +0100
committerGravatar Maxime Dénès <mail@maximedenes.fr>2016-11-02 16:05:07 +0100
commit2c5eef988f11979175de6d1983bc533ce18b1095 (patch)
tree52fd4bf2c873bbfc746485c474ca897b4a2bff78 /parsing/g_vernac.ml4
parent7ba82ed9f595c7d93bd40846993c2447572a817a (diff)
Fix various shortcomings of the warnings infrastructure.
- The flags are now interpreted from left to right, without any other precedence rule. The previous one did not make much sense in interactive mode. - Set Warnings and Set Warnings Append are now synonyms, and have the "append" semantics, which is the most natural one for warnings. - Warnings on unknown warnings are now printed only once (previously the would be repeated on further calls to Set Warnings, sections closing, module requiring...). - Warning status strings are normalized, so that e.g. "+foo,-foo" is reduced to "-foo" (if foo exists, "" otherwise).
Diffstat (limited to 'parsing/g_vernac.ml4')
-rw-r--r--parsing/g_vernac.ml413
1 files changed, 9 insertions, 4 deletions
diff --git a/parsing/g_vernac.ml4 b/parsing/g_vernac.ml4
index e0d836df8..a33e7257a 100644
--- a/parsing/g_vernac.ml4
+++ b/parsing/g_vernac.ml4
@@ -866,11 +866,16 @@ GEXTEND Gram
| "Set"; table = option_table; v = option_value ->
begin match v with
| StringValue s ->
- let (last, prefix) = List.sep_last table in
- if String.equal last "Append" && not (List.is_empty prefix) then
- VernacSetAppendOption (prefix, s)
+ (* We make a special case for warnings because appending is their
+ natural semantics *)
+ if CString.List.equal table ["Warnings"] then
+ VernacSetAppendOption (table, s)
else
- VernacSetOption (table, v)
+ let (last, prefix) = List.sep_last table in
+ if String.equal last "Append" && not (List.is_empty prefix) then
+ VernacSetAppendOption (prefix, s)
+ else
+ VernacSetOption (table, v)
| _ -> VernacSetOption (table, v)
end
| "Set"; table = option_table ->