> Ian Lance Taylor <[EMAIL PROTECTED]> writes:
> 
> >Another approach would be to only use the carets for parse errors,
> >which is where they are the most helpful.  
> 
> And preprocessor if possible
> 
> [also sometimes I would love to have an option in gcc to just
> display the preprocessed input when something bad happens inside
> a macro. I usually do that from hand using gcc -E, but it would be cool
> if the compiler could do it automatically, ideally with carets]
> 
> > What do other compilers do?  Reopening the file doesn't work for
> > standard input, which I admit is an unusual case.
> 
> I think it would be reasonable to just not display the carets 
> if the input is not seekable. Surely qemu doesn't need carets 
> for once.

It seems to me that keeping whole input buffer in memory (that is often
simply mmapped) is not bad option at all for a moment. Our memory
consumption exceeds source of input program in most cases anyway and it
ought to be very easy change in future.

Adding support for releasing large buffers from memory and either
seeking or not displaying carrets if it turns out to be important on the
top of the in-memory implementation seems straighforward: the line
location would be anyway something like file ID+offset in the file and
it does not matter much if the underlying mechanism is memory
buffer/mmap area or seek&read.

Implementing something like file compression seem bit expensive approach
for me.  Lexing+parsing is slow enough.

Honza
> 
> -Andi

Reply via email to