aboutsummaryrefslogtreecommitdiffstats
path: root/lib/drl/parser.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-03-07 20:47:16 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-03-07 20:47:16 -0300
commit54015bfbe98cfd850e1a6c142d8f514a9f48ddd9 (patch)
treeaf7b4f44e39a1057ea3a69e638f87f6727f47f01 /lib/drl/parser.ml
parentcde2893e3edf916c03c834eef7af9023258a34fb (diff)
downloadSakura-54015bfbe98cfd850e1a6c142d8f514a9f48ddd9.tar.gz
Sakura-54015bfbe98cfd850e1a6c142d8f514a9f48ddd9.zip
wip: drl executor
Diffstat (limited to '')
-rw-r--r--lib/drl/parser.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/drl/parser.ml b/lib/drl/parser.ml
new file mode 100644
index 0000000..71d694b
--- /dev/null
+++ b/lib/drl/parser.ml
@@ -0,0 +1,9 @@
+type error = ParseError of string
+
+let of_string s =
+ match Sexplib.Sexp.of_string s |> Ast.query_of_sexp with
+ | q -> Ok q
+ | exception exn -> Error (ParseError (Printexc.to_string exn))
+
+let to_string q =
+ Ast.sexp_of_query q |> Sexplib.Sexp.to_string_hum