[PATCH] Format's W directive not handling shared structures correctly.

Charles Turner chturne@gmail.com
Thu Dec 1 23:56:00 GMT 2011


On 30 November 2011 23:55, Charles Turner <chturne@gmail.com> wrote:
> On 27 November 2011 23:10, Per Bothner <per@bothner.com> wrote:
>> The result is "#1=((a . z) #1# #1#)" but IMO it should be
>> "(#1=(a . z) #1# #1#)".  Could you look into it?
>
> I'll try and look into this at some point this week.

The problem was that PrettyWriter#startLogicalBlock didn't enqueue a
logical block queue item when we encountered open parens, since FORMAT
is creating a string, we're in a prettyPritingMode of zero. The queue
items are used in resolveBackReferences, since they were not existent,
the gap buffer wasn't skipping past them, hence the first position
marker being written first.

My solution was to check if we're doing a shared printing, and if so,
enqueue the logical block items anyway, even though they won't be used
for any formatting, they'll just be used as markers in
resolveBackReferences. A bit wasteful, but I can't think of a better
solution to this right now.

I think I've incorporated all your changes in this patch.

Charlie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: formatW.patch
Type: text/x-patch
Size: 11582 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/kawa/attachments/20111201/5f0a9af4/attachment-0001.bin>


More information about the Kawa mailing list