1 exception LexerException
of string
2 let lexer_token_safe lexbuf
=
4 with Failure s
-> raise
(LexerException s
)
8 let line = input_line stdin
in
10 let tree = Parser.tex_expr
lexer_token_safe (Lexing.from_string
line) in
11 let out = Util.mapjoin
Texutil.render_tex
tree in
12 (match Html.render
tree with
13 Some _
-> print_string
"$^\n"
14 | None
-> print_string
"$_\n";
17 Texutil.Illegal_tex_function s
-> print_string
("$T" ^ s ^
" " ^
line ^
"\n")
18 | LexerException s
-> print_string
("$L" ^
line ^
"\n")
19 | _
-> print_string
("$ " ^
line ^
"\n"));