diff options
Diffstat (limited to 'lib/analysers/headers.ml')
-rw-r--r-- | lib/analysers/headers.ml | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/analysers/headers.ml b/lib/analysers/headers.ml index 916dfee..cbeddfb 100644 --- a/lib/analysers/headers.ml +++ b/lib/analysers/headers.ml @@ -1,7 +1,5 @@ open StdLabels -module I = ImportConf module E = ImportExpression.T -module Syntax = ImportConf.Syntax module Table = ImportDataTypes.Table module Path = ImportDataTypes.Path @@ -15,7 +13,7 @@ end) type content = string array type t = content SheeetMap.t -(** The map associate a line of headers for each table. +(** The map associate a line of headers for each table. The header are always in string. *) @@ -23,9 +21,8 @@ type t = content SheeetMap.t and will reformat the first line with the values from the cell. The functions will not be evaluated (instead they will be displayed "as is". - When there is no value for this path, return empty string. - *) -let columns : Syntax.t -> t -> string list = + When there is no value for this path, return empty string. *) +let columns : ImporterSyntax.t -> t -> string list = fun conf t -> (* We build here a custom printer which search in the array for the column name. @@ -33,7 +30,7 @@ let columns : Syntax.t -> t -> string list = This function will be given as argument in the expression printer. *) let f : Path.t -> Buffer.t -> unit = fun path b -> - let source = I.get_table_for_name conf path.alias in + let source = ImporterSyntax.get_table_for_name conf path.alias in match SheeetMap.find_opt source t with | None -> () @@ -42,12 +39,13 @@ let columns : Syntax.t -> t -> string list = | _ -> prerr_endline @@ Printf.sprintf "No header found for :%s.%s" - (Option.value ~default:(I.root_table conf).Table.name + (Option.value + ~default:(ImporterSyntax.root_table conf).Table.name path.alias) - (ImportCSV.Csv.column_to_string path.column)) + (ImportDataTypes.Path.column_to_string path.column)) in - List.map conf.Syntax.columns ~f:(fun column -> + List.map conf.ImporterSyntax.columns ~f:(fun column -> let b = Buffer.create 4 in ImportExpression.Headers.headers_of_expression b f column; |