diff options
| author | Maxime Dénès | 2016-09-27 15:13:00 +0200 |
|---|---|---|
| committer | Maxime Dénès | 2016-09-27 15:13:00 +0200 |
| commit | 6c1de7bcc111390400b0791cc910c86d9060333b (patch) | |
| tree | 205e968e203f9cb0d2e1499c6d88d923190e8771 /lib | |
| parent | 0b218382841f56408558a09bc7de823319ac8772 (diff) | |
| parent | 89fc40027cd083ea26b58b135ede487f665bc7b9 (diff) | |
Merge remote-tracking branch 'github/pr/290' into trunk
Was PR#290: Add a compatibility flag for 8.6 and refactor.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/flags.ml | 24 | ||||
| -rw-r--r-- | lib/flags.mli | 2 |
2 files changed, 15 insertions, 11 deletions
diff --git a/lib/flags.ml b/lib/flags.ml index 13525165ab..df00eba7ba 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 *) diff --git a/lib/flags.mli b/lib/flags.mli index 8fe64d24fa..e498dc6b5b 100644 --- a/lib/flags.mli +++ b/lib/flags.mli @@ -62,7 +62,7 @@ val raw_print : bool ref val record_print : bool ref val univ_print : bool ref -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 val compat_version : compat_version ref val version_strictly_greater : compat_version -> bool val version_less_or_equal : compat_version -> bool |
