diff --git a/src/format/opamFormula.ml b/src/format/opamFormula.ml index 96e651175e7..1acff0411fc 100644 --- a/src/format/opamFormula.ml +++ b/src/format/opamFormula.ml @@ -11,6 +11,8 @@ type relop = [`Eq|`Neq|`Geq|`Gt|`Leq|`Lt] +let all_relop = [ `Eq ; `Neq ; `Geq ; `Gt ; `Leq ; `Lt ] + let neg_relop = function | `Eq -> `Neq | `Neq -> `Eq diff --git a/src/format/opamFormula.mli b/src/format/opamFormula.mli index 6b5539eb093..65d1dba4879 100644 --- a/src/format/opamFormula.mli +++ b/src/format/opamFormula.mli @@ -17,6 +17,13 @@ type relop = OpamParserTypes.FullPos.relop_kind (* = [ `Eq | `Neq | `Geq | `Gt | val compare_relop : relop -> relop -> int +(** A list containing each available operator once. *) +val all_relop : relop list + +(** Returns a string representing the operator in infix syntax, as + used in opam files (">", "=", etc.) *) +val string_of_relop : relop -> string + (** Version constraints for OPAM *) type version_constraint = relop * OpamPackage.Version.t