Eliom错误:{client {}}

时间:2014-12-22 00:41:30

标签: client ocaml ocsigen

我遇到了一个我不知道如何解决的错误。我有以下代码(来自Eliom Graffiti教程),我试图用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!"
}}

错误:

$ 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

第18行是{client{出现的地方

2 个答案:

答案 0 :(得分:2)

graffiti.ml应命名为graffiti.eliom,AFAIK。

答案 1 :(得分:1)

~path[""]似乎至少缺少:

(我把你的代码粘贴到Emacs中就抓住了这个;语法高亮显示了它。)