aboutsummaryrefslogtreecommitdiffstats
path: root/lib/scl/sublanguage.ml
blob: 526e7a2107fc81e296aa7d10c7b544b7b6c6ba44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Make (NT : Nt.S) = struct
  module Exec = Executor.Make (NT)

  type configuration = unit
  type ast = Ast.statement

  let name = "scl"
  let parse _ = Ok ()
  let parse_sexp sexp = Parser.of_sexp sexp

  let execute ctx ast =
    Exec.execute ctx ast
    |> Result.map (function
      | Executor.Batch {cursor_id; rows; has_more} ->
          Sublanguage_types.Cursor {cursor_id; rows; has_more}
      | Executor.Closed delta -> Sublanguage_types.Transition delta )
end