[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" *)



retitle 659002 camlp4o has quotations enabled by default
tags 659002 upstream
forwarded 659002 http://caml.inria.fr/mantis/view.php?id=5508
thanks

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

   Here is the original call:

   ocamlopt -pp 'camlp4o pa_macro.cmo' brackets.ml

OK, the problem is that camlp4o has quotations enabled by
default. If you are interested in history see
https://sympa-roc.inria.fr/wws/arc/caml-list/2002-10/msg00706.html

If you use 'camlp4o -no_quot pa_macro' you get the error message
that you expect:

File "brackets.ml", line 3, characters 0-1443 (end at line 60, character 0):
Comment not terminated
File "brackets.ml", line 1, characters 0-1:
Error: Preprocessor error


I filed an upstream bug report about camlp4o and quotations, see 
http://caml.inria.fr/mantis/view.php?id=5508

I believe the error message you get with -no_quot is sufficient,
therefore I tagged this report as being an upstream problem.


   However, first it is very strange to have a rule "quotation marks must
   be balanced within comments". There is no good reason to defeat this
   rule, IMHO. 

In OCaml you can comment an arbitrary block of valid code by
putting '(*' at the beginning and '*)' at the end. That's why
strings, chars and quotations are parsed inside comments and why
they have to be properly balanced. Other languages do not enjoy
this property.


Bye,

Hendrik



Reply to: