Mantis - Bisect
Erweiterte Problemanzeige
40 general kleinerer Fehler immer 2009-06-04 19:51 2009-06-07 17:20
mfurr  
xclerc  
normal  
geschlossen  
erledigt  
keine    
keine 1.0beta  
0000040: Fails with << in comments
bisect seems to have trouble when '<<' and '>>' appear in comments.
Here's a small example:
 type t =
   | A (* << *)
   | B (* >> *)
Running 'camlp4o .../instrument.cma' on a file with this definition prints:
  let _ = Bisect.Runtime.init "foo.ml"
  type t = | A

The constructor for B has disappeared!
Problem-Historie
2009-06-04 19:51 mfurr Neues Problem
2009-06-05 21:41 xclerc Problemnotiz hinzugefügt: 0000181
2009-06-05 21:41 xclerc Bearbeitung durch => xclerc
2009-06-05 21:41 xclerc Status neu => anerkannt
2009-06-07 17:20 xclerc Problemnotiz hinzugefügt: 0000184
2009-06-07 17:20 xclerc Status anerkannt => geschlossen
2009-06-07 17:20 xclerc Lösung offen => erledigt
2009-06-07 17:20 xclerc Behoben in Version => 1.0beta

Notiz
(0000181)
xclerc   
2009-06-05 21:41   
A preliminary investigation seems to indicate that this problems stems
from camlp4's quotations (*). Camlp4 views the "<<" string as the start
of a quotation and ">>" as its end. Moreover, if no ">>" is provided,
camlp4 will complain, reporting that a quotation is not terminated.

My first interpretation is that this is a camlp4 bug but some in-depth
understanding of camlp4 is needed to confirm that. I have thus contacted
Nicolas Pouillard (camlp4 guru) and will update this report with any
additional information.


(*) http://brion.inria.fr/gallium/index.php/Quotation) [^]
(0000184)
xclerc   
2009-06-07 17:20   
Well, I have to made public apologies for the mistake in the previous note.
As explained by Nicolas Pouillard, the reported behaviour is indeed expected.

The idea is that quotations behaves here as strings would: when embedded
inside comments, they have to be properly closed (this behaviour is clearly
needed if you want to always be able to properly comment out strings or
quotations).

On the reported example, this means that the comment opened right after
"A" ends on the "*)" that follows the end of the quotation. A similar example
on strings is that the following program will print "abc":
  let () = print_endline (* " ABC DEF *) " *) "abc"


The obvious conclusion is that this bug report is closed with no modification
on the code base. However, the next version of the manual will be enriched
with a note warning the Bisect user of possible camlp4 interactions.