Reorganize code and document functions

This commit is contained in:
Guillaume 2026-03-13 23:27:28 +01:00
parent 96b3fc6c52
commit 5752995272
9 changed files with 93 additions and 41 deletions

15
lib/repl.ml Normal file
View file

@ -0,0 +1,15 @@
let rec loop state =
print_string "inspector> ";
flush stdout;
try
match read_line () |> String.lowercase_ascii with
| "exit" | "quit" -> print_endline "bye"
| "next" -> loop (State.next state)
| "prev" -> loop (State.prev state)
| "show" ->
Printf.printf "[%d]: %s\n" (State.cursor state) (State.show_line state);
loop state
| str ->
print_endline str;
loop state
with End_of_file -> print_endline "bye"