diff options
author | Maxence Guesdon <maxence.guesdon@inria.fr> | 2013-08-05 08:56:06 +0000 |
---|---|---|
committer | Maxence Guesdon <maxence.guesdon@inria.fr> | 2013-08-05 08:56:06 +0000 |
commit | bf6e4860e801f2f4d2256dc1a830fba6f52d39f5 (patch) | |
tree | fb146bdb864ba17070f3090ff717089fceb6ce85 | |
parent | 8e971575b7b09d6a39c22d5e8f7e5306305225d9 (diff) |
PR#6069: improve ocamldoc error message (bis)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13978 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | ocamldoc/odoc_lexer.mll | 4 | ||||
-rw-r--r-- | ocamldoc/odoc_messages.ml | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/ocamldoc/odoc_lexer.mll b/ocamldoc/odoc_lexer.mll index bb86f59f3..998d31bd1 100644 --- a/ocamldoc/odoc_lexer.mll +++ b/ocamldoc/odoc_lexer.mll @@ -293,6 +293,10 @@ and elements = parse incr Odoc_comments_global.nb_chars; print_DEBUG2 "newline"; elements lexbuf } + | "@" + { + raise (Failure (Odoc_messages.should_escape_at_sign)) + } | "@"lowercase+ { diff --git a/ocamldoc/odoc_messages.ml b/ocamldoc/odoc_messages.ml index 1d80e88b3..2d6327bba 100644 --- a/ocamldoc/odoc_messages.ml +++ b/ocamldoc/odoc_messages.ml @@ -246,6 +246,7 @@ let file_not_found_in_paths paths name = (String.concat "\n" paths) let tag_not_handled tag = "Tag @"^tag^" not handled by this generator" +let should_escape_at_sign = "The character @ has a special meaning in ocamldoc comments, for commands such as @raise or @since. If you want to write a single @, you must escape it as \\@." let bad_tree = "Incorrect tree structure." let not_a_valid_tag s = s^" is not a valid tag." let fun_without_param f = "Function "^f^" has no parameter.";; |