aboutsummaryrefslogtreecommitdiffstats
path: root/lib/drl
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/drl
parent99ac1e7d9b77d69f2a85a108468d4433953d8269 (diff)
downloadSakura-e10acd09faf53c636b653c4df034716545db5fab.tar.gz
Sakura-e10acd09faf53c636b653c4df034716545db5fab.zip
dml and dcl
Diffstat (limited to '')
-rw-r--r--lib/drl/ast.ml7
-rw-r--r--lib/drl/executor.ml7
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/drl/ast.ml b/lib/drl/ast.ml
index f94965d..2beb010 100644
--- a/lib/drl/ast.ml
+++ b/lib/drl/ast.ml
@@ -8,6 +8,13 @@ type value =
| Bool of bool
[@@deriving sexp]
+(** Convert an AST value to an AbstractValue.t (Obj.t) via Obj.repr *)
+let value_to_abstract : value -> Conventions.AbstractValue.t = function
+ | Int n -> Obj.repr n
+ | Float f -> Obj.repr f
+ | Str s -> Obj.repr s
+ | Bool b -> Obj.repr b
+
type direction = Asc | Desc
[@@deriving sexp]
diff --git a/lib/drl/executor.ml b/lib/drl/executor.ml
index 7588b33..27f52c2 100644
--- a/lib/drl/executor.ml
+++ b/lib/drl/executor.ml
@@ -8,12 +8,7 @@ module Make(Storage : Management.Physical.S) = struct
let wrap = Result.map_error (fun e -> AlgebraError e)
- (* Convert Ast.value → AbstractValue.t (Obj.t) via Obj.repr *)
- let ast_value_to_abstract : Ast.value -> Conventions.AbstractValue.t = function
- | Ast.Int n -> Obj.repr n
- | Ast.Float f -> Obj.repr f
- | Ast.Str s -> Obj.repr s
- | Ast.Bool b -> Obj.repr b
+ let ast_value_to_abstract = Ast.value_to_abstract
let rec execute
(storage : Storage.t)