colis-anr / morbig

A static parser for POSIX Shell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yojson 2 support

SnarkBoojum opened this issue · comments

The following patch should add yojson 2 support:

--- morbig.orig/src/CSTHelpers.mli
+++ morbig/src/CSTHelpers.mli
@@ -19,8 +19,8 @@
 val nonempty_program : program -> bool
 val concat_programs : program located -> program located -> program located
 
-val complete_command_to_json : complete_command -> Yojson.Safe.json
-val program_to_json : program -> Yojson.Safe.json
+val complete_command_to_json : complete_command -> Yojson.Safe.t
+val program_to_json : program -> Yojson.Safe.t
 
 (** {2 Helpers about words and names} *)
 
--- morbig.orig/morbig.opam
+++ morbig/morbig.opam
@@ -31,7 +31,7 @@
   "odoc"                 {with-doc}
   "ppx_deriving_yojson"
   "visitors"             {>= "20180513"}
-  "yojson"
+  "yojson"               {>= "2.0.2"}
 ]
 
 build: ["dune" "build" "-p" name "-j" jobs]

Hi @SnarkBoojum!

Sorry for the very late response, and thank you very much for your patch. The support for Yojson 2 was added as a side-effect of f87190d. The lower bound for Yojson was only put to 1.6.0 because that is sufficient for Yojson.Safe.t to exist. However, latest runs of the CI definitely chose Yojson 2.0.2 from OPAM.

Best,

Note that version 0.11.0 is now out and it includes the support for Yojson 2.