aboutsummaryrefslogblamecommitdiffstats
path: root/lib/dml/sublanguage.ml
blob: a67ec663e113ca1f8b53a215cba9c3e0d5663f43 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                  
 
                           

                          

                  
                     





                                                              


                                                         



                                        
module Make (NT : Nt.S) = struct
  module Exec = Executor.Make (NT)

  type configuration = unit
  type ast = Ast.statement
  type error = Exec.error

  let name = "dml"
  let parse _ = Ok ()

  let parse_sexp sexp =
    match Parser.of_sexp sexp with
    | Ok r -> Ok r
    | Error (Parser.ParseError s) -> Error (Exec.ParseError s)

  let execute ctx ast =
    match Exec.execute ctx ast with
    | Ok delta -> Ok (Sublanguage_types.Transition delta)
    | Error e -> Error e

  let sexp_of_error = Exec.sexp_of_error
end