Skip to content

Commit

Permalink
Do not allow !=
Browse files Browse the repository at this point in the history
Only allow <> and suggest this operator when != is used

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Apr 24, 2019
1 parent 383389a commit aae17cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
base-unix
base-threads)
(conflicts
(jbuilder (!= "transition"))
(jbuilder (<> "transition"))
(odoc (< 1.3.0)))
(synopsis "Fast, portable and opinionated build system")
(description "
Expand Down
14 changes: 9 additions & 5 deletions src/dune_project.ml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ module Opam = struct
; ">", Gt
; "<", Lt
; "<>", Neq
; "!=", Neq ]
]

let to_dyn =
let open Dyn.Encoder in
Expand Down Expand Up @@ -249,11 +249,15 @@ module Opam = struct

let decode =
let open Stanza.Decoder in
let ops =
List.map Op.map ~f:(fun (name, op) ->
name, (let+ x = Var.decode in Uop (op, x)))
in
let ops =
("!=", let+ loc = loc in of_sexp_error loc "Use <> instead of !=")
:: ops
in
fix begin fun t ->
let ops =
List.map Op.map ~f:(fun (name, op) ->
name, (let+ x = Var.decode in Uop (op, x)))
in
let logops =
[ "and", (let+ x = repeat t in And x)
; "or", (let+ x = repeat t in Or x)
Expand Down

0 comments on commit aae17cb

Please sign in to comment.