colis-anr / morbig

A static parser for POSIX Shell
Other
190 stars 8 forks source link

yojson 2 support #134

Closed SnarkBoojum closed 1 year ago

SnarkBoojum commented 1 year ago

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]
Niols commented 1 year ago

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,

Niols commented 1 year ago

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