OCaml: Add a configuration lexer

This commit is contained in:
Juno Takano 2025-04-30 19:46:12 -03:00
commit 902734d610
4 changed files with 129 additions and 2 deletions

View file

@ -1,8 +1,7 @@
(* the side effect could be extracted to a log list in the schema *)
let identify : string =
let os_release = String.split_on_char '\n' (File.read "/etc/os-release") in
Utilities.Log.elog (String.concat "\n" os_release);
let os_equals = List.find (String.starts_with ~prefix:"NAME=") os_release in
match String.split_on_char '=' os_equals with
| [ _; s ] ->