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: 5745 Reporter: johnlepikhin Assigned to:@gasche Status: closed (set by @xavierleroy on 2015-12-11T18:08:02Z) Resolution: not a bug Priority: normal Severity: minor Version: 3.12.1 Category: ~DO NOT USE (was: OCaml general) Monitored by: meyer @gasche
Bug description
Ocaml parser doesn't ignores quotes inside comments and requires all quotations to be closed.
I'm not sure why this well-known behavior should be considered a bug. It is occasionally surprising but also useful (and easy to check with syntax colouring). Are you suggesting a particular change or improvement to the documentation?
Well, I use Ocaml in my daily work for 5 years, but seems like that was the first day when I tried to add unclosed quotation mark into comment :) Your response is surprised me. I think it's time to close this bug.
We should provide escape of the single in form of ". Tools like ocamldoc or ocamlweb extract comments, and taken that " means inch in imperial units, it's fairly possible to hit the undesired behavior. There is an obvious workaround for that to use '' or special markup escapes.
In retrospect I guess that my initial answer was a bit harsh. johnlepikhin, I'm sorry for that.
I understand that not everyone knows about this and that it can be surprising. I don't think we should change this (the risk of introducing a backward-incompatible lexer bug seems greater than the benefits), especially since there is already a rather explicit error raised in this case.
If you want to use a single " inside a comment, I recommend '' as a workaround.
I'm marking the bug as "resolved" to get it out the of hot list. If someone (meyer?) is strongly convinced that there is a better solution, don't hesitate to comment.
Original bug ID: 5745
Reporter: johnlepikhin
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2015-12-11T18:08:02Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 3.12.1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: meyer @gasche
Bug description
Ocaml parser doesn't ignores quotes inside comments and requires all quotations to be closed.
Error:
$ echo '(* "test *)' | ocaml
Objective Caml version 3.12.1
(* "test *)
*
Error: This comment contains an unterminated string literal
OK:
$ echo '(* "test" *)' | ocaml
Objective Caml version 3.12.1
The text was updated successfully, but these errors were encountered: