123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869(*********************************************************************************)(* Chamo *)(* *)(* Copyright (C) 2003-2021 Institut National de Recherche en Informatique *)(* et en Automatique. All rights reserved. *)(* *)(* This program is free software; you can redistribute it and/or modify *)(* it under the terms of the GNU Lesser General Public License version *)(* 3 as published by the Free Software Foundation. *)(* *)(* This program is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU General Public License for more details. *)(* *)(* You should have received a copy of the GNU General Public License *)(* along with this program; if not, write to the Free Software *)(* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *)(* 02111-1307 USA *)(* *)(* Contact: Maxence.Guesdon@inria.fr *)(* *)(*********************************************************************************)letoutput_name="ocamltop";;classocamltop_output?(on_destroy=fun()->())name=object(self)inheritOutputs.text_output~on_destroynameassuperinitializer(*let lang = Gtksv_utils.source_language_manager#guess_language
~content_type: "text/x-ocaml" ()
in
*)super#view#set_source_language(Some"text/x-ocaml");(*
super#view#source_buffer#set_highlight_syntax true;
super#view#source_buffer#set_highlight_matching_brackets true;
*)end;;letocamltop_output=refNone;;letocamltop_output()=match!ocamltop_outputwithNone->leto=newocamltop_output~on_destroy:(fun()->ocamltop_output:=None)output_nameinocamltop_output:=Someo;o|Someo->o;;letprint_ocaml_output?(output=ocamltop_output())args=letoutputs=Outputs.outputs()inbegintryignore(outputs#output_by_nameoutput#name)withNot_found->outputs#add_output(output:>Outputs.output);end;outputs#showoutput#name;ignore(output#insert(ifArray.lengthargs<1then""elseargs.(0)));Lwt.return_unit;;Commands.register(Commands.create_com"print_ocaml_output"[|"string"|](print_ocaml_output?output:None));;