From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA18597; Tue, 22 Oct 2002 14:41:01 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA18268 for ; Tue, 22 Oct 2002 14:41:00 +0200 (MET DST) Received: from mel-rto4.wanadoo.fr (smtp-out-4.wanadoo.fr [193.252.19.23]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g9MCexD05825; Tue, 22 Oct 2002 14:40:59 +0200 (MET DST) Received: from mel-rta8.wanadoo.fr (193.252.19.79) by mel-rto4.wanadoo.fr (6.5.007) id 3DA24D320091163A; Tue, 22 Oct 2002 14:40:59 +0200 Received: from iliana (80.14.193.120) by mel-rta8.wanadoo.fr (6.5.007) id 3DA24B4A008D6A5D; Tue, 22 Oct 2002 14:40:59 +0200 Received: from luther by iliana with local (Exim 3.36 #1 (Debian)) id 183yLB-0000hU-00; Tue, 22 Oct 2002 14:40:57 +0200 Date: Tue, 22 Oct 2002 14:40:57 +0200 To: Daniel de Rauglaudre Cc: caml-list@inria.fr Subject: Re: [Caml-list] Camlp4 pretty print comments Message-ID: <20021022124057.GA2661@iliana> References: <20021022111642R.garrigue@kurims.kyoto-u.ac.jp> <20021022131530.A3558@verdot.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021022131530.A3558@verdot.inria.fr> User-Agent: Mutt/1.4i From: Sven Luther Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Oct 22, 2002 at 01:15:30PM +0200, Daniel de Rauglaudre wrote: > Hi, > > On Mon, Oct 21, 2002 at 09:35:47PM -0700, Quetzalcoatl Bradley wrote: > > > > Why are comments not printed when the input is from standard input? > > Because comments are not represented in the syntax tree. To pretty > print, Camlp4 reads the file again, using the locations inside the > syntax tree to determine where the comments are located. > > If the input file is standard input, it is not possible since it is > not possible to read it twice. What about storing the comments when parsing the standard input with their location in the file, so you can easily add them again when generating the file ? Friendly, Sven Luther ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners