summaryrefslogtreecommitdiffstats
path: root/ocamldoc/odoc_parser.mly
diff options
context:
space:
mode:
Diffstat (limited to 'ocamldoc/odoc_parser.mly')
-rw-r--r--ocamldoc/odoc_parser.mly18
1 files changed, 18 insertions, 0 deletions
diff --git a/ocamldoc/odoc_parser.mly b/ocamldoc/odoc_parser.mly
index 0d9d814d2..e62dcc551 100644
--- a/ocamldoc/odoc_parser.mly
+++ b/ocamldoc/odoc_parser.mly
@@ -34,6 +34,7 @@ let print_DEBUG s = print_string s; print_newline ()
%token T_VERSION
%token T_SEE
%token T_SINCE
+%token T_BEFORE
%token T_DEPRECATED
%token T_RAISES
%token T_RETURN
@@ -81,6 +82,7 @@ element:
| version { () }
| see { () }
| since { () }
+| before { () }
| deprecated { () }
| raise_exc { () }
| return { () }
@@ -122,6 +124,22 @@ see:
since:
T_SINCE Desc { since := Some $2 }
;
+before:
+ T_BEFORE Desc
+ {
+ (* isolate the version name *)
+ let s = $2 in
+ match Str.split (Str.regexp (blank^"+")) s with
+ []
+ | _ :: [] ->
+ raise (Failure "usage: @before version description")
+ | id :: _ ->
+ print_DEBUG ("version "^id);
+ let remain = String.sub s (String.length id) ((String.length s) - (String.length id)) in
+ let remain2 = Str.replace_first (Str.regexp ("^"^blank^"+")) "" remain in
+ before := !before @ [(id, remain2)]
+ }
+;
deprecated:
T_DEPRECATED Desc { deprecated := Some $2 }
;