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 MAA28158; Tue, 11 Sep 2001 12:52:56 +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 MAA28148 for ; Tue, 11 Sep 2001 12:52:55 +0200 (MET DST) Received: from dpt-info.u-strasbg.fr (dpt-info.u-strasbg.fr [130.79.44.193]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f8BAqs109309; Tue, 11 Sep 2001 12:52:54 +0200 (MET DST) Received: (from luther@localhost) by dpt-info.u-strasbg.fr (8.9.3/8.9.3) id MAA29718; Tue, 11 Sep 2001 12:53:25 +0200 Date: Tue, 11 Sep 2001 12:53:25 +0200 From: Sven To: David Mentre Cc: Vesa Karvonen , caml-list@inria.fr Subject: Re: [Caml-list] line number for assert Message-ID: <20010911125325.A29665@dpt-info.u-strasbg.fr> References: <001301c13aa5$9ffff090$422aa8c0@housemarque.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from David.Mentre@inria.fr on Tue, Sep 11, 2001 at 11:51:50AM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Sep 11, 2001 at 11:51:50AM +0200, David Mentre wrote: > "Vesa Karvonen" writes: > > > The assert primitive of Ocaml 3.02 (windows version) seems to print the source > > file location as an offset from the beginning of the file rather than as a > > line number and column. > > > > Is there a particular reason for this? > > Yes. Internally, the compiler knows only about character position. The > line number is computed (in fact the source file is reparsed) only when > an error message is printed: > http://caml.inria.fr/archives/200011/msg00032.html > > > The reason why I'm asking this is that it makes it much more difficult to find > > the right assertion on most editors. > > Except with emacs. :) > > > Is there a simple way to overcome this limitation? > > As far as I know, no. However you should look at mailing list > archive. This topic has been discussed numerous times. What about a little tool to be added to the ocaml distribution, which parses a file, and convert the char number to line number + column. I guess, from what is already done by the toplevel, that this would be trivial to implement, as all the code for it is already written. Friendly, Sven Luther ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr