[PATCH] Pass pratt parsed token to expr parser functions to fix expr locus
Mark Wielaard
mark@klomp.org
Mon Aug 9 14:24:47 GMT 2021
Hi,
On Sat, Aug 07, 2021 at 03:01:39AM +0200, Mark Wielaard wrote:
> > Sorry for lack of reply on this. After looking into this and also
> > getting Arthur Cohen to review, I think:
> >
> > * Token passing: If we end up using the token for more than the
> > location this might be useful but at present I can't think of a
> > use-case for the token. If we do need it maybe we could look into
> > passing it by reference.
> > * Location passing: I think this is the best solution and is directly
> > associated with the issue you have fixed. The function says that you
> > can call me but tell me the location as well so its up to the caller
> > to handle this. We should add a comment to the function prototypes
> > to say what the location is but that's it.
> >
> > What do you think?
>
> OK, lets go with the location passing. I added a comment to the
> function prototypes in rust-parse.h about the passed in
> pratt_parsed_token.
>
> https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=pass-pratt-parse-token
Looks like I said I'll do B, then did A anyway... duh. Sorry. Here is
the patch as I said I would do it, also on this branch, rebased
against upstream:
https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=pass-pratt-parse-loc
Cheers,
Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Pass-pratt-parsed-location-to-expr-parser-functions-.patch
Type: text/x-diff
Size: 22587 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-rust/attachments/20210809/527dfbc6/attachment.bin>
More information about the Gcc-rust
mailing list