Guest User

Untitled

a guest
Feb 16th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. From e32217d0c441364bf69ed5c9edbf88cea850a036 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Gr=C3=A9goire=20Henry?=
  3. <gregoire.henry@pps.univ-paris-diderot.fr>
  4. Date: Wed, 24 Jul 2013 12:05:20 +0200
  5. Subject: [PATCH] ocamldoc: better error message for 'Desc' token. Fix #6069.
  6.  
  7. ---
  8. ocamldoc/odoc_lexer.mll | 5 +++++
  9. ocamldoc/odoc_messages.ml | 1 +
  10. 2 files changed, 6 insertions(+)
  11.  
  12. diff --git a/ocamldoc/odoc_lexer.mll b/ocamldoc/odoc_lexer.mll
  13. index cabcfc2..e4f6174 100644
  14. --- a/ocamldoc/odoc_lexer.mll
  15. +++ b/ocamldoc/odoc_lexer.mll
  16. @@ -294,6 +294,11 @@ and elements = parse
  17. print_DEBUG2 "newline";
  18. elements lexbuf }
  19.  
  20. + | "@"
  21. + {
  22. + raise (Failure (Odoc_messages.should_escape_at_sign))
  23. + }
  24. +
  25. | "@"lowercase+
  26. {
  27. let s = Lexing.lexeme lexbuf in
  28. diff --git a/ocamldoc/odoc_messages.ml b/ocamldoc/odoc_messages.ml
  29. index 1d80e88..92482a3 100644
  30. --- a/ocamldoc/odoc_messages.ml
  31. +++ b/ocamldoc/odoc_messages.ml
  32. @@ -171,6 +171,7 @@ let no_toc = "\tDo not generate table of contents "^latex_only
  33. let sort_modules = "\tSort the list of top modules before generating the documentation"
  34. let no_stop = "\tDo not stop at (**/**) comments"
  35. let no_custom_tags = "\n\t\tDo not allow custom @-tags"
  36. +let should_escape_at_sign = "\n\t\tThe 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 \\@."
  37. let remove_stars = "\tRemove beginning blanks of comment lines, until the first '*'"
  38. let keep_code = "\tAlways keep code when available"
  39. let inverse_merge_ml_mli = "\n\t\tInverse implementations and interfaces when merging"
  40. --
  41. 1.7.10.4
Add Comment
Please, Sign In to add comment