Skip to content

Commit

Permalink
Add and export relop related utils
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Barbin <[email protected]>
  • Loading branch information
mbarbin authored and rjbou committed Oct 25, 2024
1 parent ab1bdb9 commit 6a08602
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ users)
## opam-solver

## opam-format
* `OpamFormula.string_of_relop`: export function [#6197 @mbarbin]
* `OpamFormula.all_relop`: a list of all operators [#6197 @mbarbin]

## opam-core
* `OpamStd.Sys.{get_terminal_columns,uname,getconf,guess_shell_compat}`: Harden the process calls to account for failures [#6230 @kit-ty-kate - fix #6215]
Expand Down
2 changes: 2 additions & 0 deletions src/format/opamFormula.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/format/opamFormula.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6a08602

Please sign in to comment.