File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -262,8 +262,6 @@ let raw_markup =
262262let raw_markup_target =
263263 ([^ ':' '%' ] | '%' + [^ ':' '%' '}' ])* '%' *
264264
265- let math_block = raw_markup
266-
267265let language_tag_char =
268266 ['a' - 'z' 'A' - 'Z' '0' - '9' '_' '-' ]
269267
@@ -366,19 +364,13 @@ rule token input = parse
366364 { verbatim
367365 (Buffer. create 1024 ) None (Lexing. lexeme_start lexbuf) input lexbuf }
368366
369- | " {%math" horizontal_space (raw_markup as s) (" %}" | eof as e)
370- { let token = `Math (true , s) in
371- if e <> " %}" then
372- warning
373- input
374- ~start_offset: (Lexing. lexeme_end lexbuf)
375- (Parse_error. not_allowed
376- ~what: (Token. describe `End )
377- ~in_what: (Token. describe token));
378- emit input token }
379367 | " {%" ((raw_markup_target as target) ':' )? (raw_markup as s)
380368 (" %}" | eof as e)
381- { let token = `Raw_markup (target, s) in
369+ { let token =
370+ match target with
371+ | Some "math" -> `Math (true , s)
372+ | _ -> `Raw_markup (target, s)
373+ in
382374 if e <> " %}" then
383375 warning
384376 input
Original file line number Diff line number Diff line change @@ -5310,7 +5310,7 @@ let%expect_test _ =
53105310let%expect_test _ =
53115311 let module Math = struct
53125312 let block =
5313- test "{%math \\sum_{i=0}^n x^i%}";
5313+ test "{%math: \\sum_{i=0}^n x^i%}";
53145314 [%expect {|
53155315 ((output
53165316 (((f.ml (1 0) (1 25))
You can’t perform that action at this time.
0 commit comments