From 2824476c7a3274f7f469e118210cf1c14e277faa Mon Sep 17 00:00:00 2001 From: Keryan Didier Date: Fri, 5 Feb 2021 17:26:04 +0100 Subject: [PATCH 1/2] new internal operator for '~' semantic versioning --- src/opamLexer.mll | 2 +- src/opamParserTypes.ml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opamLexer.mll b/src/opamLexer.mll index 26b0228..5845d5d 100644 --- a/src/opamLexer.mll +++ b/src/opamLexer.mll @@ -27,7 +27,7 @@ let relop = function | ">" -> `Gt | "<=" -> `Leq | "<" -> `Lt - | "~" -> `Geq + | "~" -> `Sem | x -> error "%S is not a valid comparison operator" x let logop = function diff --git a/src/opamParserTypes.ml b/src/opamParserTypes.ml index 84aadeb..8370001 100644 --- a/src/opamParserTypes.ml +++ b/src/opamParserTypes.ml @@ -20,6 +20,7 @@ type relop = [ `Eq (** [=] *) | `Gt (** [>] *) | `Leq (** [<=] *) | `Lt (** [<] *) + | `Sem (** [~] *) ] (** Logical operators *) From 519683af0e0eb2f72e44c51c466e4fb1328cec38 Mon Sep 17 00:00:00 2001 From: Keryan Didier Date: Thu, 11 Feb 2021 11:55:09 +0100 Subject: [PATCH 2/2] tests for new operator --- tests/fullpos.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/fullpos.ml b/tests/fullpos.ml index 30e3b91..df45279 100644 --- a/tests/fullpos.ml +++ b/tests/fullpos.ml @@ -54,6 +54,7 @@ module Value = struct "greater-than", ">", `Gt; "lesser-or-equal", "<=", `Leq; "lesser-than", "<", `Lt; + "semver", "~", `Sem; ] let logop = [ "disj", "&", `And;