From d88b51aea64199a7670d2804694832c66ee35518 Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Mon, 26 Sep 2016 11:31:39 +0200 Subject: Add a compatibility flag for 8.6 and refactor. --- lib/flags.ml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'lib/flags.ml') diff --git a/lib/flags.ml b/lib/flags.ml index 13525165a..df00eba7b 100644 --- a/lib/flags.ml +++ b/lib/flags.ml @@ -108,20 +108,23 @@ let we_are_parsing = ref false (* Current means no particular compatibility consideration. For correct comparisons, this constructor should remain the last one. *) -type compat_version = V8_2 | V8_3 | V8_4 | V8_5 | Current +type compat_version = V8_2 | V8_3 | V8_4 | V8_5 | V8_6 | Current let compat_version = ref Current let version_strictly_greater v = match !compat_version, v with -| V8_2, (V8_2 | V8_3 | V8_4 | V8_5 | Current) -> false -| V8_3, (V8_3 | V8_4 | V8_5 | Current) -> false -| V8_4, (V8_4 | V8_5 | Current) -> false -| V8_5, (V8_5 | Current) -> false -| Current, Current -> false -| V8_3, V8_2 -> true -| V8_4, (V8_2 | V8_3) -> true -| V8_5, (V8_2 | V8_3 | V8_4) -> true -| Current, (V8_2 | V8_3 | V8_4 | V8_5) -> true +| _ , Current -> false +| Current , _ -> true +| _ , V8_6 -> false +| V8_6 , _ -> true +| _ , V8_5 -> false +| V8_5 , _ -> true +| _ , V8_4 -> false +| V8_4 , _ -> true +| _ , V8_3 -> false +| v8_3 , _ -> true +| V8_2 , V8_2 -> false + let version_less_or_equal v = not (version_strictly_greater v) @@ -130,6 +133,7 @@ let pr_version = function | V8_3 -> "8.3" | V8_4 -> "8.4" | V8_5 -> "8.5" + | V8_6 -> "8.6" | Current -> "current" (* Translate *) -- cgit v1.2.3 From daae678047ee2a1c53d4dc423976f77e40ba753f Mon Sep 17 00:00:00 2001 From: Matej Kosik Date: Wed, 28 Sep 2016 16:08:40 +0200 Subject: FIX: a bug in the pattern matching --- lib/flags.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/flags.ml') diff --git a/lib/flags.ml b/lib/flags.ml index df00eba7b..40b7a29d2 100644 --- a/lib/flags.ml +++ b/lib/flags.ml @@ -122,7 +122,7 @@ let version_strictly_greater v = match !compat_version, v with | _ , V8_4 -> false | V8_4 , _ -> true | _ , V8_3 -> false -| v8_3 , _ -> true +| V8_3 , _ -> true | V8_2 , V8_2 -> false -- cgit v1.2.3