aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dml/parser.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-03-08 20:36:31 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-03-08 20:36:31 -0300
commite10acd09faf53c636b653c4df034716545db5fab (patch)
tree570d34526016df383a4b1821d9fe1dc864ef0c16 /lib/dml/parser.ml
parent99ac1e7d9b77d69f2a85a108468d4433953d8269 (diff)
downloadSakura-e10acd09faf53c636b653c4df034716545db5fab.tar.gz
Sakura-e10acd09faf53c636b653c4df034716545db5fab.zip
dml and dcl
Diffstat (limited to 'lib/dml/parser.ml')
-rw-r--r--lib/dml/parser.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/dml/parser.ml b/lib/dml/parser.ml
new file mode 100644
index 0000000..a7981c0
--- /dev/null
+++ b/lib/dml/parser.ml
@@ -0,0 +1,9 @@
+type error = ParseError of string
+
+let of_string s =
+ match Sexplib.Sexp.of_string s |> Ast.statement_of_sexp with
+ | stmt -> Ok stmt
+ | exception exn -> Error (ParseError (Printexc.to_string exn))
+
+let to_string stmt =
+ Ast.sexp_of_statement stmt |> Sexplib.Sexp.to_string_hum