Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
ocamllex -ml does not generate code compilable with -safe-string #7323
Original bug ID: 7323
It generates code like this
let c = lexbuf.Lexing.lex_buffer.[i] in
where lex_buffer is a buffer, and
Comment author: @gasche
Good point, and should be relatively easy to fix (by using Bytes.get instead).
Using Bytes.get means that code generated from new versions of ocamllex will not compile under old versions of the standard library, but I think this is just fine -- people using an old compiler can use an old ocamllex to regenerate the parser.