PoignardAzur / venial

"A very small syn"
MIT License
196 stars 7 forks source link

Support for lifetimes in receiver parameters #56

Closed Bromeon closed 9 months ago

Bromeon commented 9 months ago

Adds support for lifetimes in function receiver parameters:

fn method(&'a self);
fn prototype<'b>(&'b mut self);

This adds a new type Lifetime which is also reused in GenericArg. I thought that makes more sense than separate (Punct, Ident) tuples, as I could also imagine to add some utility parsing functions in the future. Let me know what you think.

Based on #55, the interesting diff is here, in 2 commits.

PoignardAzur commented 9 months ago

LGTM, needs a rebase.

Bromeon commented 9 months ago

Rebased. Also added the missing Item::as_*() methods to get direct access to a certain item type.