12345678910111213141516171819202122232425262728293031323334353637383940414243444546(*
This is reviced version of Jg_template.
https://github.com/tategakibunko/jingoo/issues/112
*)openJg_types(** Internally, interpretted result is outputed to `output:(string -> unit)` interface. *)type'ainternal_interp=?env:Jg_types.environment->?models:(string->Jg_types.tvalue)->output:(Jg_types.tvalue->unit)->?ctx:Jg_types.context->'a->unit(** Externally, interpretted result is outputed as string. *)type'aexternal_interp=?env:Jg_types.environment->?ctx:Jg_types.context->?models:(string->Jg_types.tvalue)->'a->stringletcontent(fn:'ainternal_interp):'aexternal_interp=fun?(env=std_env)?ctx?(models=fun_->Tnull)(arg:'a)->letbuffer=Buffer.create1024inletoutputx=Buffer.add_stringbuffer(Jg_runtime.string_of_tvaluex)inlet()=fn~env~models~output?ctxarginBuffer.contentsbufferletfrom_chan=content(Jg_interp.RevicedApi.from_chan?file_path:None)letfrom_file=contentJg_interp.RevicedApi.from_fileletfrom_string=content(Jg_interp.RevicedApi.from_string?file_path:None)moduleLoaded=structtypet=Jg_interp.Loaded.tletfrom_chan?envchan=Jg_interp.Loaded.from_chan?envchanletfrom_file?envfile_name=Jg_interp.Loaded.from_file?envfile_nameletfrom_string?envsource=Jg_interp.Loaded.from_string?envsourceleteval?ctx?(models=fun_->Tnull)t=letbuffer=Buffer.create1024inletoutputx=Buffer.add_stringbuffer(Jg_runtime.string_of_tvaluex)inlet()=Jg_interp.Loaded.evalt~models~output?ctx()inBuffer.contentsbufferend