and token = lexer
*)
+
+let remove_quotes s = String.sub s 1 (String.length s - 2)
+
let rec token comments = lexer
| blanks -> token comments lexbuf
| uri -> return lexbuf ("URI", Ulexing.utf8_lexeme lexbuf)
| meta -> return lexbuf ("META", Ulexing.utf8_lexeme lexbuf)
| implicit -> return lexbuf ("IMPLICIT", Ulexing.utf8_lexeme lexbuf)
| qstring ->
- let lexeme = Ulexing.utf8_lexeme lexbuf in
- let s = String.sub lexeme 1 (String.length lexeme - 2) in
- return lexbuf ("QSTRING", s)
+ return lexbuf ("QSTRING", remove_quotes (Ulexing.utf8_lexeme lexbuf))
| symbol -> return lexbuf ("SYMBOL", Ulexing.utf8_lexeme lexbuf)
| tex_token ->
let macro =