[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#659002: ocaml-nox: ocaml-compiler with mysterious effects if somewhere a comment with open quotation, example (* 3" *)



Hi,

how do you compile your sample file? When I compile with ocamlc I
get 

    File "brackets.ml", line 3, characters 0-2:
    Error: Comment not terminated

I believe it's an OCaml feature, that strings inside comments
must be terminated (but I cannot find it in the manual).

Andreas Romeyke <andreas.romeyke@dzb.de> writes:

   If you add somewhere in your code a comment with open quotation, the

Do you actually mean a comment with a lonely quotation mark char
(`"') or do you mean a comment with a lonely camlp4/camlp5
quotation marker (`<<' or `>>') ?

   compiler
   sometimes produces binaries with partial broken functionality or aborts
   compilation with error message of this pattern:

Could it be that you had code such as

    let f = function 
     | A -> 0 (* " *)
     | B -> 1 (* " *)
     | C -> 2

where the B-case is in fact inside a string inside the _single_
comment in f? (Which you easily see because the compiler says
"pattern matching not exhaustive".)

   We hat a heisenbug where the compiler creates a working binary without
   any
   error-message, but completely different behaviour, if somewhere was a
   comment
   of form (* << *) or (* >> *), but this was very hard to reproduce and
   catch in
   an example-file.

>From this I would guess that this bug should actually be assigned
to camlp4 or camlp5.

Maybe you had 

  (* << *) 
  some code
  (* >> *)

? Then ``some code'' is inside a quotation inside a comment.

Bye,

Hendrik



Reply to: