aboutsummaryrefslogblamecommitdiffstats
path: root/lib/vcl/sublanguage.ml
blob: 437c93b37525aad27c0be354b36f41e517a5cb9f (plain) (tree)
1
2
3
4
5
6
7
8
                                

                       


                                                                                             

     



                                  




                           

                                                                          

                            
   
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