{"action":"opened","issue":{"url":"https://api.github.com/repos/ocaml/camlp4/issues/68","labels_url":"https://api.github.com/repos/ocaml/camlp4/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/camlp4/issues/68/comments","events_url":"https://api.github.com/repos/ocaml/camlp4/issues/68/events","html_url":"https://github.com/ocaml/camlp4/issues/68","id":53899882,"number":68,"title":"Incorrect/unwanted behavior on invalid string inputs (Mantis 4885)","user":{"login":"planar","id":19104,"avatar_url":"https://avatars.githubusercontent.com/u/19104?v=3","gravatar_id":"","url":"https://api.github.com/users/planar","html_url":"https://github.com/planar","followers_url":"https://api.github.com/users/planar/followers","following_url":"https://api.github.com/users/planar/following{/other_user}","gists_url":"https://api.github.com/users/planar/gists{/gist_id}","starred_url":"https://api.github.com/users/planar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/planar/subscriptions","organizations_url":"https://api.github.com/users/planar/orgs","repos_url":"https://api.github.com/users/planar/repos","events_url":"https://api.github.com/users/planar/events{/privacy}","received_events_url":"https://api.github.com/users/planar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-09T18:37:26Z","updated_at":"2015-01-09T18:37:26Z","closed_at":null,"body":"Transferred from http://caml.inria.fr/mantis/view.php?id=4885\r\nFeel free to reopen the Mantis PR if you need to modify the OCaml lexer to deal with this.\r\n\r\n-\r\nThere are two unwanted behaviors on the treatment of string literals in camlp4.\r\n\r\n(1) Incomplete decimal/hexadecimal character escapes cause unspecified errors.\r\n```\r\n$ echo '\"\\0\"' | camlp4o -impl /dev/stdin\r\nWarning: File \"/dev/stdin\", line 1, characters 1-3: Illegal backslash escape in string or character (0)\r\nParse error: \r\n$\r\n```\r\n(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)."}}