New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unterminated quote causes crash #4718
Comments
Comment author: @zoggy Having an unterminated string in a comment is an ocaml error: cat > t.ml(* "coucou le commentaire avec une mauvaise chaine *) #ocaml t.ml This is not an ocamldoc related problem. The error occurs when calling the ocaml parser. |
Comment author: aostruszka Applies to both ocamlc and camlp4 (3.11.2) $ cat dupa.ml $ ocamlc dupa.ml $ ocamlc -pp camlp4o dupa.ml |
Comment author: Camarade_Tux This also lead to the disappearance of code sometimes. I just had a whole chunk of a file that disappeared because of that behaviour.
(* a " a *)let x = 42 in Maybe that having lone " between (* and *) should be forbidden? Or at least, it could emit a warning. I hopefully had camlp4 parsing and also had to see the temp file instead of the source directly, but without that, I would probably have spent some time on this issue. |
Comment author: @glondu
Is this documented somewhere? I would expect it in section 6.1 ("Lexical conventions", paragraph "Comments"), but couldn't find mention of this even by grepping through the whole manual. |
Comment author: @xavierleroy I can't reproduce the crash with OCaml 4.00 dev. Closing this PR. $ cat foo.ml |
Original bug ID: 4718
Reporter: warren
Status: closed (set by @xavierleroy on 2012-09-25T18:10:24Z)
Resolution: unable to duplicate
Priority: normal
Severity: crash
Version: 3.10.2
Category: ocamldoc
Monitored by: @glondu
Bug description
If an ocamldoc-style comment contains an unterminated quote, a crash occurs when preprocessing the file, e.g.
(** hello " *)
Fatal error: exception Loc.Exc_located(_, _)
Raised at file "camlp4/Camlp4/Struct/Lexer.mll", line 186, characters 9-46
Called from file "camlp4/Camlp4/Struct/Lexer.mll", line 357, characters 12-54
Called from file "camlp4/Camlp4/Struct/Lexer.mll", line 155, characters 4-21
Called from file "camlp4/Camlp4/Struct/Lexer.mll", line 294, characters 26-63
Called from file "camlp4/Camlp4/Struct/Lexer.mll", line 454, characters 16-37
Called from file "stream.ml", line 78, characters 22-36
Called from file "stream.ml", line 111, characters 8-14
Called from file "build/optcomp/optcomp.ml", line 96, characters 42-48
Called from file "stream.ml", line 78, characters 22-36
Called from file "build/optcomp/pa_optcomp.ml", line 365, characters 47-53
Called from file "build/optcomp/pa_optcomp.ml", line 558, characters 26-38
Called from file "build/optcomp/pa_optcomp.ml", line 678, characters 48-57
Called from file "stream.ml", line 78, characters 22-36
Called from file "stream.ml", line 124, characters 10-19
Called from file "build/optcomp/optcomp.ml", line 111, characters 6-167
Re-raised at file "build/optcomp/optcomp.ml", line 96, characters 24-147
Called from file "build/optcomp/optcomp_o.ml", line 12, characters 21-23
Preprocessing error on file src/core/extlib/substring.mli
The text was updated successfully, but these errors were encountered: