From 483a98a65afc945aede08c0ca279fecf4b588ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=BChler?= <david.buhler@cea.fr> Date: Fri, 11 Feb 2022 09:42:14 +0100 Subject: [PATCH] [Metrics] Pivot table: circumvent a bug in the server API generation. Uses jarray instead of jlist. --- .../api/generated/plugins/pivot/general/index.ts | 10 +++++----- src/plugins/metrics/metrics_pivot.ml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ivette/src/frama-c/api/generated/plugins/pivot/general/index.ts b/ivette/src/frama-c/api/generated/plugins/pivot/general/index.ts index a27718e3908..16efe72359d 100644 --- a/ivette/src/frama-c/api/generated/plugins/pivot/general/index.ts +++ b/ivette/src/frama-c/api/generated/plugins/pivot/general/index.ts @@ -41,13 +41,13 @@ import * as State from 'frama-c/states'; /** State of the pivot table source data. */ export type tableStateType = string[][]; -/** Loose decoder for `tableStateType` */ -export const jTableStateType: Json.Loose<tableStateType> = - Json.jList(Json.jList(Json.jString)); - /** Safe decoder for `tableStateType` */ export const jTableStateTypeSafe: Json.Safe<tableStateType> = - jTableStateType; + Json.jArray(Json.jArray(Json.jFail(Json.jString,'String expected'))); + +/** Loose decoder for `tableStateType` */ +export const jTableStateType: Json.Loose<tableStateType> = + Json.jTry(jTableStateTypeSafe); /** Natural order for `tableStateType` */ export const byTableStateType: Compare.Order<tableStateType> = diff --git a/src/plugins/metrics/metrics_pivot.ml b/src/plugins/metrics/metrics_pivot.ml index b2beb87cfe8..78cc4db8fb9 100644 --- a/src/plugins/metrics/metrics_pivot.ml +++ b/src/plugins/metrics/metrics_pivot.ml @@ -282,7 +282,7 @@ let headers = ["Directory"; "Filename"; "Extension"; "Line Number"; let add_entry_str entry = let dir, fname, ext, line = split_loc entry.loc in - let funcname = Option.fold ~none:"" ~some:Stdlib__fun.id entry.func in + let funcname = Option.fold ~none:"" ~some:Stdlib.Fun.id entry.func in let domain, kind = split_domain entry.domain in let names = string_of_string_list ":" entry.names in let entry = [dir; fname; ext; line; funcname; @@ -512,7 +512,7 @@ module TableState = struct Data.declare ~package ~name:"tableStateType" ~descr:(Markdown.plain "State of the pivot table source data.") - Package.(Jlist (Jlist Jstring)) + Package.(Jarray (Jarray Jstring)) let to_json ll = `List (List.rev_map (fun l -> `List (List.map (fun s -> `String s) l)) ll) end -- GitLab