diff --git a/infer/src/backend/Differential.ml b/infer/src/backend/Differential.ml index 4cabb1ea5..36578285b 100644 --- a/infer/src/backend/Differential.ml +++ b/infer/src/backend/Differential.ml @@ -131,7 +131,7 @@ type t = { introduced: Jsonbug_t.report ; fixed: Jsonbug_t.report ; preexisting: Jsonbug_t.report - ; costs_summary: Yojson.Basic.json } + ; costs_summary: Yojson.Basic.t } let to_map key_func report = List.fold_left diff --git a/infer/src/backend/Differential.mli b/infer/src/backend/Differential.mli index acb9c1595..677155b3c 100644 --- a/infer/src/backend/Differential.mli +++ b/infer/src/backend/Differential.mli @@ -11,7 +11,7 @@ type t = { introduced: Jsonbug_t.report ; fixed: Jsonbug_t.report ; preexisting: Jsonbug_t.report - ; costs_summary: Yojson.Basic.json } + ; costs_summary: Yojson.Basic.t } val of_reports : current_report:Jsonbug_t.report diff --git a/infer/src/backend/PerfStats.mli b/infer/src/backend/PerfStats.mli index 82a6289e1..1b1f27dcb 100644 --- a/infer/src/backend/PerfStats.mli +++ b/infer/src/backend/PerfStats.mli @@ -24,9 +24,9 @@ type stats_type = | Reporting | Driver -val from_json : Yojson.Basic.json -> perf_stats +val from_json : Yojson.Basic.t -> perf_stats -val aggregate : perf_stats list -> Yojson.Basic.json +val aggregate : perf_stats list -> Yojson.Basic.t val register_report : stats_kind -> stats_type -> unit (** Register performance reporting function *) diff --git a/infer/src/backend/StatsAggregator.ml b/infer/src/backend/StatsAggregator.ml index 54206e227..44df4adee 100644 --- a/infer/src/backend/StatsAggregator.ml +++ b/infer/src/backend/StatsAggregator.ml @@ -108,9 +108,9 @@ let aggregate_stats_files paths = type json_aggregated_stats = - { frontend_json_data: Yojson.Basic.json option - ; backend_json_data: Yojson.Basic.json option - ; reporting_json_data: Yojson.Basic.json option } + { frontend_json_data: Yojson.Basic.t option + ; backend_json_data: Yojson.Basic.t option + ; reporting_json_data: Yojson.Basic.t option } let aggregate_all_stats origin = let accumulate_paths acc paths = diff --git a/infer/src/backend/inferconfig.ml b/infer/src/backend/inferconfig.ml index 42604373b..7e22e22e1 100644 --- a/infer/src/backend/inferconfig.ml +++ b/infer/src/backend/inferconfig.ml @@ -218,7 +218,7 @@ let patterns_of_json_with_key (json_key, json) = error in (* Translate a JSON entry into a matching pattern *) - let create_pattern (assoc : (string * Yojson.Basic.json) list) = + let create_pattern (assoc : (string * Yojson.Basic.t) list) = let create_method_pattern assoc = let loop mp = function | key, `String s when String.equal key "class" -> diff --git a/infer/src/base/CommandLineOption.ml b/infer/src/base/CommandLineOption.ml index 2c8548775..2195eeb17 100644 --- a/infer/src/base/CommandLineOption.ml +++ b/infer/src/base/CommandLineOption.ml @@ -98,7 +98,7 @@ type desc = ; doc: string ; spec: spec (** how to go from an option in the json config file to a list of command-line options *) - ; decode_json: inferconfig_dir:string -> Yojson.Basic.json -> string list } + ; decode_json: inferconfig_dir:string -> Yojson.Basic.t -> string list } let dashdash ?short long = match (long, short) with diff --git a/infer/src/base/CommandLineOption.mli b/infer/src/base/CommandLineOption.mli index 1794d8ce7..4d6a70768 100644 --- a/infer/src/base/CommandLineOption.mli +++ b/infer/src/base/CommandLineOption.mli @@ -134,7 +134,7 @@ val mk_symbol_seq : [] is a comma-separated sequence of []s such that [(,_)] is an element of [symbols]. *) -val mk_json : Yojson.Basic.json ref t +val mk_json : Yojson.Basic.t ref t val mk_anon : unit -> string list ref (** [mk_anon ()] defines a [string list ref] of the anonymous command line arguments, in the reverse diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 63f03e9e8..c4e8f64b0 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -133,13 +133,13 @@ val os_type : os_type val passthroughs : bool -val patterns_modeled_expensive : string * Yojson.Basic.json +val patterns_modeled_expensive : string * Yojson.Basic.t -val patterns_never_returning_null : string * Yojson.Basic.json +val patterns_never_returning_null : string * Yojson.Basic.t -val patterns_skip_implementation : string * Yojson.Basic.json +val patterns_skip_implementation : string * Yojson.Basic.t -val patterns_skip_translation : string * Yojson.Basic.json +val patterns_skip_translation : string * Yojson.Basic.t val perf_stats_prefix : string @@ -225,11 +225,11 @@ val analysis_suppress_errors : string list val annotation_reachability : bool -val annotation_reachability_cxx : Yojson.Basic.json +val annotation_reachability_cxx : Yojson.Basic.t -val annotation_reachability_cxx_sources : Yojson.Basic.json +val annotation_reachability_cxx_sources : Yojson.Basic.t -val annotation_reachability_custom_pairs : Yojson.Basic.json +val annotation_reachability_custom_pairs : Yojson.Basic.t val anon_args : string list @@ -312,7 +312,7 @@ val cxx : bool val cxx_infer_headers : bool -val cxx_scope_guards : Yojson.Basic.json +val cxx_scope_guards : Yojson.Basic.t val debug_exceptions : bool @@ -469,7 +469,7 @@ val litho : bool val liveness : bool -val liveness_dangerous_classes : Yojson.Basic.json +val liveness_dangerous_classes : Yojson.Basic.t val log_events : bool @@ -570,13 +570,13 @@ val pure_by_default : bool val quandary : bool -val quandary_endpoints : Yojson.Basic.json +val quandary_endpoints : Yojson.Basic.t -val quandary_sanitizers : Yojson.Basic.json +val quandary_sanitizers : Yojson.Basic.t -val quandary_sinks : Yojson.Basic.json +val quandary_sinks : Yojson.Basic.t -val quandary_sources : Yojson.Basic.json +val quandary_sources : Yojson.Basic.t val quandaryBO : bool @@ -656,7 +656,7 @@ val sqlite_vfs : string option val starvation : bool -val starvation_skip_analysis : Yojson.Basic.json +val starvation_skip_analysis : Yojson.Basic.t val starvation_strict_mode : bool @@ -676,7 +676,7 @@ val test_filtering : bool val testing_mode : bool -val threadsafe_aliases : Yojson.Basic.json +val threadsafe_aliases : Yojson.Basic.t val topl_properties : string list diff --git a/infer/src/base/Utils.mli b/infer/src/base/Utils.mli index dd1086954..840d18cd7 100644 --- a/infer/src/base/Utils.mli +++ b/infer/src/base/Utils.mli @@ -50,7 +50,7 @@ val directory_iter : (string -> unit) -> string -> unit val directory_is_empty : string -> bool (** Returns true if a given directory is empty. The directory is assumed to exist. *) -val read_json_file : string -> (Yojson.Basic.json, string) Result.t +val read_json_file : string -> (Yojson.Basic.t, string) Result.t val with_file_in : string -> f:(In_channel.t -> 'a) -> 'a @@ -59,7 +59,7 @@ val with_file_out : string -> f:(Out_channel.t -> 'a) -> 'a val with_intermediate_temp_file_out : string -> f:(Out_channel.t -> 'a) -> 'a (** like [with_file_out] but uses a fresh intermediate temporary file and rename to avoid write-write races *) -val write_json_to_file : string -> Yojson.Basic.json -> unit +val write_json_to_file : string -> Yojson.Basic.t -> unit val consume_in : In_channel.t -> unit (** consume and ignore all the lines from the channel until End_of_file is reached *) @@ -114,20 +114,20 @@ val strip_balanced_once : drop:(char -> bool) -> string -> string string; for instance, [strip_balanced ~drop:(function | 'a' | 'x' -> true | _ -> false) "xaabax"] returns "aaba" *) -val assoc_of_yojson : Yojson.Basic.json -> src:string -> (string, Yojson.Basic.json) List.Assoc.t +val assoc_of_yojson : Yojson.Basic.t -> src:string -> (string, Yojson.Basic.t) List.Assoc.t (** Verify we have a json object (or empty list) and return the corresponding assoc list. Otherwise die with a message including src. *) -val string_of_yojson : Yojson.Basic.json -> src:string -> string +val string_of_yojson : Yojson.Basic.t -> src:string -> string (** Verify we have a json string and return the corresponding ocaml string. Otherwise die with a message including src. *) -val string_list_of_yojson : Yojson.Basic.json -> src:string -> string list +val string_list_of_yojson : Yojson.Basic.t -> src:string -> string list (** Verify we have a json list of strings and return the corresponding ocaml string list. Otherwise die with a message including src. *) val yojson_lookup : - (string, Yojson.Basic.json) List.Assoc.t + (string, Yojson.Basic.t) List.Assoc.t -> string -> src:string - -> f:(Yojson.Basic.json -> src:string -> 'a) + -> f:(Yojson.Basic.t -> src:string -> 'a) -> default:'a -> 'a (** Lookup a json value on an assoc list. If not present, returns default. Otherwise returns (f json_value ~src) where src has element name appended. f is typically one of the above _of_yojson functions. *) diff --git a/infer/src/clang/CTLExceptions.mli b/infer/src/clang/CTLExceptions.mli index f62e6145e..a7a71ac21 100644 --- a/infer/src/clang/CTLExceptions.mli +++ b/infer/src/clang/CTLExceptions.mli @@ -17,4 +17,4 @@ exception ALFileException of exc_info val create_exc_info : string -> Lexing.lexbuf -> exc_info -val json_of_exc_info : exc_info -> Yojson.Basic.json +val json_of_exc_info : exc_info -> Yojson.Basic.t diff --git a/infer/src/concurrency/MethodMatcher.mli b/infer/src/concurrency/MethodMatcher.mli index 3153baf6b..afe469cc6 100644 --- a/infer/src/concurrency/MethodMatcher.mli +++ b/infer/src/concurrency/MethodMatcher.mli @@ -7,7 +7,7 @@ open! IStd -(** pattern matcher for Java/C++ methods +(** pattern matcher for Java/C++ methods NB matching is modulo template arguments in C++ classes and functions *) type t = Tenv.t -> Typ.Procname.t -> HilExp.t list -> bool @@ -25,7 +25,7 @@ val default : record val of_record : record -> t (** make a matcher out of a record; optional values use defaults *) -val of_json : Yojson.Basic.json -> t +val of_json : Yojson.Basic.t -> t (** Parse a JSon object into a matcher. The Json object must be a list of records, each corresponding to a single matcher. Each record must have a ["classname"] field with a [string] value, and a ["methods"] field with a list of strings. The record may also have boolean diff --git a/infer/src/istd/StatisticsToolbox.mli b/infer/src/istd/StatisticsToolbox.mli index 540cffd5e..282c2df6f 100644 --- a/infer/src/istd/StatisticsToolbox.mli +++ b/infer/src/istd/StatisticsToolbox.mli @@ -9,6 +9,6 @@ open! IStd type t -val to_json : t -> Yojson.Basic.json +val to_json : t -> Yojson.Basic.t val compute_statistics : float list -> t option diff --git a/infer/src/quandary/QuandaryConfig.mli b/infer/src/quandary/QuandaryConfig.mli index a0ac363aa..0144fe9cf 100644 --- a/infer/src/quandary/QuandaryConfig.mli +++ b/infer/src/quandary/QuandaryConfig.mli @@ -12,19 +12,19 @@ open! IStd module Source : sig type t = {procedure: string; kinds: string list; index: string} - val of_json : [> `List of Yojson.Basic.json list] -> t list + val of_json : [> `List of Yojson.Basic.t list] -> t list end module Sink : sig type t = {procedure: string; kinds: string list; index: string} - val of_json : [> `List of Yojson.Basic.json list] -> t list + val of_json : [> `List of Yojson.Basic.t list] -> t list end module Sanitizer : sig type t = {procedure: string; kind: string} - val of_json : [> `List of Yojson.Basic.json list] -> t list + val of_json : [> `List of Yojson.Basic.t list] -> t list end val is_endpoint : string -> bool diff --git a/opam b/opam index f338ed69e..aded10cc4 100644 --- a/opam +++ b/opam @@ -47,7 +47,7 @@ depends: [ "sqlite3" "utop" {with-test} "xmlm" {>="1.2.0"} - "yojson" {<"1.6.0"} + "yojson" {>="1.7.0"} "zarith" {>="1.7"} ] depexts: [ diff --git a/opam.locked b/opam.locked index e6aa01ed0..bf445851a 100644 --- a/opam.locked +++ b/opam.locked @@ -120,7 +120,7 @@ depends: [ "typerep" {= "v0.11.0"} "variantslib" {= "v0.11.0"} "xmlm" {= "1.3.0"} - "yojson" {= "1.4.1"} + "yojson" {= "1.7.0"} "zarith" {= "1.7"} ] depexts: [