From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 92CAEBC57 for ; Tue, 31 Aug 2010 10:29:22 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqABAO9ZfExRZ90vkWdsb2JhbACTHY0CTBUBAQEBCQsKBxEDH71UhTcEigk X-IronPort-AV: E=Sophos;i="4.56,297,1280700000"; d="scan'208";a="56215091" Received: from mtaout01-winn.ispmail.ntl.com ([81.103.221.47]) by mail3-smtp-sop.national.inria.fr with ESMTP; 31 Aug 2010 10:29:21 +0200 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20100831082921.ZZDG3266.mtaout01-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Tue, 31 Aug 2010 09:29:21 +0100 Received: from romulus.metastack.com ([81.102.132.77]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20100831082919.XQRE22376.aamtaout04-winn.ispmail.ntl.com@romulus.metastack.com>; Tue, 31 Aug 2010 09:29:19 +0100 Received: from remus.metastack.local ([172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id o7V8TAfr012013 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 31 Aug 2010 09:29:10 +0100 Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%11]) with mapi; Tue, 31 Aug 2010 09:28:21 +0100 From: David Allsopp To: "'Hendrik Tews'" , "'caml-list@inria.fr'" Subject: RE: [Caml-list] quotations inside comments? Thread-Topic: [Caml-list] quotations inside comments? Thread-Index: AQHLSN+ixjg3jDEPNE62EaSCKSxcipL7OYCw Date: Tue, 31 Aug 2010 08:25:08 +0000 Message-ID: References: <19580.45516.666334.202997@blau.inf.tu-dresden.de> In-Reply-To: <19580.45516.666334.202997@blau.inf.tu-dresden.de> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 81.102.132.77 X-Cloudmark-Analysis: v=1.1 cv=3ENABmdyEd/Fm7fR7+mZIuMDn6+IErAeEhlfWBImZFk= c=1 sm=0 a=ycFBmCOxdeYA:10 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=ZOzjf2MOAAAA:8 a=n06BfVqjAAAA:20 a=rCze_xskQGnS72My9fsA:9 a=Wx1bfe9bDztfWgltur4A:7 a=oECvx1ahEksDwk3xy9CTm0zHBakA:4 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-Spam: no; 0.00; camlp:01 compiler:01 literals:01 foo:01 compiler:01 foo:01 syntax:01 camlp:01 -impl:01 lexing:01 lexing:01 parsers:01 lexers:01 syntax:01 hendrik:01 > Hi, >=20 > why does camlp4 parse quotations inside comments? Eg I don't know for certain, but I guess it might be for the same reason as th= e compiler which checks string literals (amongst other things) inside comme= nts e.g. (* This will not compile " *) File "foo.ml", line 1, characters 0-2: Error: This comment contains an unterminated string literal The compiler does this to ensure that you can consistently nest comments (i= .e. that commenting out a block actually comments the entire block out), wi= thout it you could write: (* let foo =3D "*)" in () *) which wouldn't behave as you'd expect (and the syntax error could be a lot = further down the file!)=20 David >=20 > echo "(* << *)" | camlp4o -impl - >=20 > gives >=20 > File "-", line 1, characters 3-9 (end at line 2, character 0): > Quotation not terminated >=20 > Quotation parsing/lexing seems to be controlled by context.quotations. Ho= w > can I switch this off? >=20 > Wouldn't it make more sense to have quotations and antiquotation > parsing/lexing switched off in freshly created parsers/lexers and switch > them only on when a syntax extension with quotations is installed (eg, > inside Camlp4QuotationCommon.Make)? >=20 > Bye, >=20 > Hendrik >=20 > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs