Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Incorrect/unwanted behavior on invalid string inputs (Mantis 4885) #68
Transferred from http://caml.inria.fr/mantis/view.php?id=4885
There are two unwanted behaviors on the treatment of string literals in camlp4.
(1) Incomplete decimal/hexadecimal character escapes cause unspecified errors.
(2) Other unharmful character escapes which are undefined in Caml syntax was useful for camlp4 extensions until 3.09, but now it produces a warning even when these are handled later by syntax extensions. Several useful syntax extensions depend on 3.09 behavior. To achieve both compatibility and safety, such checking is better to be implemented in parser (or output) instead of in lexer. The attached patch (against 3.12.0+dev5) implements the string constant validity checking in the parser stage, as well as fixing problem (1).