You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4885 Reporter: yoiwa Assigned to:@bobzhang Status: closed (set by @diml on 2016-12-07T17:25:07Z) Resolution: suspended Priority: normal Severity: minor Target version: undecided Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues Tags: patch Monitored by:@ygrek yoiwa
Bug description
There are two unwanted behaviors on the treatment of string literals in camlp4.
(1) Incomplete decimal/hexadecimal character escapes cause unspecified errors.
$ echo '"\0"' | camlp4o -impl /dev/stdin
Warning: File "/dev/stdin", line 1, characters 1-3: Illegal backslash escape in string or character (0)
Parse error:
$
(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).
Original bug ID: 4885
Reporter: yoiwa
Assigned to: @bobzhang
Status: closed (set by @diml on 2016-12-07T17:25:07Z)
Resolution: suspended
Priority: normal
Severity: minor
Target version: undecided
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Tags: patch
Monitored by: @ygrek yoiwa
Bug description
There are two unwanted behaviors on the treatment of string literals in camlp4.
(1) Incomplete decimal/hexadecimal character escapes cause unspecified errors.
$ echo '"\0"' | camlp4o -impl /dev/stdin
Warning: File "/dev/stdin", line 1, characters 1-3: Illegal backslash escape in string or character (0)
Parse error:
$
(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).
File attachments
The text was updated successfully, but these errors were encountered: