It seems ocamllex and the compiler once shared the same parsing code for OCaml-strings, but have since slightly diverged even though the manual states that they both use the same syntax.

lexer.mll for ocamllex defines "backslash_escapes" that are different from the inline pattern used in lexer.mll (rule "string") for the compiler: the latter adds a space character. Furthermore, ocamllex uses '\010' as a pattern for newlines where the compiler uses "newline", which also supports '\013' and DOS-newlines and has hence a different rule body.

It seems that the fix for this problem accidentally removed DOS-style newlines ("\013\010") rather than the Mac OS 9 "\013" from the definition of "newline" in parsing/lexer.mll. I guess this would lead to double counting of lines on Windows.

Update: "\013" may then probably need to be added to the definition of "blank" instead?

I've changed my mind. Now I think the perfect solution would be to utterly ignore all occurrences of \013 everywhere in the source file (even within identifiers or string literals). But that would be too much work for such a small problem.