Re: [PATCH] Pass pratt parsed token to expr parser functions to fix expr locus

2021-07-28 Thread The Other via Gcc-rust
I think the core idea of this patch (fixing locations) is very important and useful. But isn’t it overkill to pass the token in instead of just the location? You can avoid a fairly expensive shared_ptr copy by doing so. > On 29 Jul 2021, at 6:13 am, Mark Wielaard wrote: > > The pratt parser

[PATCH] Pass pratt parsed token to expr parser functions to fix expr locus

2021-07-28 Thread Mark Wielaard
The pratt parser skips the first token of an expression before invoking the actual expression parsing function. This makes getting the correct starting location of a pratt parsed expression hard. The "correction" of the location by subtracting an integer is often wrong (since there may be arbitrary