Eliom error: {client{}}

114 views Asked by At

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

2

There are 2 answers

0
ivg On BEST ANSWER

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

1
unhammer On

~path[""] seems to be missing a : at least

(I caught this by just pasting your code into Emacs; the syntax highlighting showed it.)