aboutsummaryrefslogtreecommitdiffstats
path: root/lib/vcl/sublanguage.ml
blob: 437c93b37525aad27c0be354b36f41e517a5cb9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Make (NT : Nt.S) = struct
  module Error = struct
    open Condition

    let unrecognized_command expr =
      condition "unrecognized-command" "Unrecognized command" ("expression" |=| of_sexp expr)
  end

  module Exec = Executor.Make (NT)

  type configuration = unit
  type ast = Ast.statement

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

  let parse_sexp = function
    | Sexplib.Sexp.(List [Atom "use"; Atom branch]) -> Ok (Ast.Use branch)
    | sexp -> Error (Error.unrecognized_command sexp)

  let execute = Exec.execute
end