summaryrefslogtreecommitdiffstats
path: root/ocamldoc/odoc_text_parser.mly
diff options
context:
space:
mode:
Diffstat (limited to 'ocamldoc/odoc_text_parser.mly')
-rw-r--r--ocamldoc/odoc_text_parser.mly13
1 files changed, 12 insertions, 1 deletions
diff --git a/ocamldoc/odoc_text_parser.mly b/ocamldoc/odoc_text_parser.mly
index 478cfa074..55909141b 100644
--- a/ocamldoc/odoc_text_parser.mly
+++ b/ocamldoc/odoc_text_parser.mly
@@ -80,8 +80,9 @@ let print_DEBUG s = print_string s; print_newline ()
%token <string> Char
/* Start Symbols */
-%start main
+%start main located_element_list
%type <Odoc_types.text> main
+%type <(int * int * Odoc_types.text_element) list> located_element_list
%%
main:
@@ -98,6 +99,16 @@ text_element_list:
| text_element text_element_list { $1 :: $2 }
;
+located_element_list:
+ located_element { [ $1 ] }
+| located_element located_element_list { $1 :: $2 }
+;
+
+located_element:
+ text_element { Parsing.symbol_start (), Parsing.symbol_end (), $1}
+;
+
+
ele_ref_kind:
ELE_REF { None }
| VAL_REF { Some RK_value }