clientocamlocsigen

Eliom error: {client{}}


I am running into an error that I do not know how to resolve. I have the following code (from the Eliom Graffiti tutorial) which I am trying to test with make test.byte.

open Eliom_content.Html5.D

module My_app =
Eliom_registration.App (struct
  let application_name = "graffiti"
end)

let main_service =
  Eliom_registration.Html5.register_service
    ~path:[""]
    ~get_params:Eliom_parameter.unit
    (fun () () ->
      Lwt.return
        (html
          (head (title (pcdata "Graffiti")) [])
          (body [h1 [pcdata "Graffiti"]])))

{client{
  let _ = Eliom_lib.alert "Hello!"
}}

Error:

$ make test.byte
eliomc -c   graffiti.ml 
File "graffiti.ml", line 18, characters 0-1:
Parse error: [label_expr_list] or [expr level .] expected after "{" (in [expr])
Error while running external preprocessor

line 18 is where {client{ appears


Solution

  • The graffiti.ml should be named graffiti.eliom, AFAIK.