From 3d2e279aa21953702b283faddaef7a0c0e264e80 Mon Sep 17 00:00:00 2001 From: Charlotte Thomas Date: Wed, 16 Mar 2022 18:36:14 +0100 Subject: [PATCH] will deal with perf later --- lib/glossary.ml | 2 +- lib/htmlgen.ml | 3 ++- lib/parser.ml | 2 +- lib/utils.ml | 2 -- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/glossary.ml b/lib/glossary.ml index 8c3b3f1..17be741 100644 --- a/lib/glossary.ml +++ b/lib/glossary.ml @@ -88,4 +88,4 @@ let recognize_gls lst = | t::q when t='{' -> aux acc q | t::q -> aux (acc^(String.make 1 t)) q in let desc,q = aux "" lst - in (Hashtbl.find glossaries desc),desc,q;; + in (Hashtbl.find glossaries desc),desc,q;; \ No newline at end of file diff --git a/lib/htmlgen.ml b/lib/htmlgen.ml index 4aeaa98..ef609dd 100644 --- a/lib/htmlgen.ml +++ b/lib/htmlgen.ml @@ -114,6 +114,7 @@ let parse_file file = | "book" -> parse_chapter str | "article" -> parse_chapter str | _ -> failwith "only articles books are supported";; + let prepare_body ?(name="TeX Created File") str nodes = let t = ""^name^"" in let t = String.cat t "\n" in @@ -130,4 +131,4 @@ let print_file ?(start_chapter=1) filename outfile name = let file = execute file in let c = print_list_of_section ~start_chapter:start_chapter file in let c = prepare_body ~name:name c file in - Utils.write_to_file outfile c;; \ No newline at end of file + Utils.write_to_file outfile c;; diff --git a/lib/parser.ml b/lib/parser.ml index e4736d5..0ea3799 100644 --- a/lib/parser.ml +++ b/lib/parser.ml @@ -178,7 +178,7 @@ let detect_prelude fichier = | _::q -> detect q in detect line_list;; - + let create_subsection = create_generic (parse_subsubsection) (fun (a,b,c) -> Subsection(a,b,c)) let parse_subsection = parse_generic "\\\\subsection" (create_subsection) diff --git a/lib/utils.ml b/lib/utils.ml index c597d8f..13ffe03 100644 --- a/lib/utils.ml +++ b/lib/utils.ml @@ -1,7 +1,6 @@ (** Utilities *) - (** A function reading the inputed file and outputs a string of the lines separated by a line break \n @param filename the file to read *) let read_file filename = @@ -52,4 +51,3 @@ let transform_list_of_chars_to_string_without_the_newline lst = | "book" -> "book" | "article" -> "article" | _ -> print_endline "only articles/books are supported"; exit 2;; - \ No newline at end of file