copied from js_of_ocaml/toplevel/examples/lwt_toplevel

This commit is contained in:
cqc
2024-02-10 16:52:36 -06:00
commit 0f1fd67e8a
20 changed files with 1391 additions and 0 deletions

14
ocp_indent.ok.ml Normal file
View File

@ -0,0 +1,14 @@
let _ = Approx_lexer.enable_extension "lwt"
let indent s in_lines =
let output =
{ IndentPrinter.debug = false
; config = IndentConfig.default
; in_lines
; indent_empty = true
; adaptive = true
; kind = IndentPrinter.Print (fun s acc -> acc ^ s)
}
in
let stream = Nstream.of_string s in
IndentPrinter.proceed output stream IndentBlock.empty ""