From 11625c88c604a143928678cadc8c9c7136c7fb2e Mon Sep 17 00:00:00 2001 From: Emin Arslan Date: Wed, 14 Jan 2026 12:28:22 +0300 Subject: [PATCH] core_ast: add of_sexpr --- lib/compiler/core_ast.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/compiler/core_ast.ml b/lib/compiler/core_ast.ml index 0cd711c..36e0d67 100644 --- a/lib/compiler/core_ast.ml +++ b/lib/compiler/core_ast.ml @@ -79,3 +79,8 @@ and of_syntactic : Syntactic_ast.top_level -> top_level = function | Def (Define (s, e)) -> Define (s, of_expr e) | Exp (e) -> Expr (of_expr e) | _ -> . + + +let of_sexpr x = + Result.bind (Syntactic_ast.make x) + (fun x -> Ok (of_syntactic x))