Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Quotes in comments: (* " *)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kim Nguyen <nguyen@b...>
Subject: Re: [Caml-list] Quotes in comments: (* " *)
On Wed, 17 Dec 2003 15:22:32 +0000
Richard Jones <rich@annexia.org> wrote:

> 
> Is there a deep reason why the compiler is fussed by unmatched quotes
> appearing in comments, ie: (* " *) ?

This seems necessary to ensure that any piece of code can easily be commented out :

(* This is a valid comment

let print_close_comment () = print_string "*)" <-- the comment does not end here.

*)

So the comment part of the  lexer needs to analyse strings as well to igonre any "*)" character sequence within a
string. And therefore, it fails when a string is unterminated.

See http://caml.inria.fr/FAQ/FAQ_EXPERT-eng.html#commentaire

IMHO, the bug should be corrected in tuareg-mode (if possible).

Cheers,

Kim.