New generics
This commit is contained in:
@@ -80,7 +80,7 @@ pub enum Prefix {
|
||||
Ref,
|
||||
RefMut,
|
||||
Deref,
|
||||
New,
|
||||
New(Option<Generics>),
|
||||
Not,
|
||||
Neg,
|
||||
RangeInclusive,
|
||||
|
||||
@@ -515,7 +515,7 @@ postfix = {
|
||||
deref_px = { "*" }
|
||||
mut_ref_px = { "&" ~ mutable }
|
||||
ref_px = { "&" }
|
||||
new_px = { "new" }
|
||||
new_px = { "new" ~ generics? }
|
||||
not_px = { "!" }
|
||||
neg_px = { "-" }
|
||||
range_start_inc_px = { "..=" }
|
||||
|
||||
@@ -134,7 +134,12 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for Prefix {
|
||||
Rule::deref_px => Self::Deref,
|
||||
Rule::mut_ref_px => Self::RefMut,
|
||||
Rule::ref_px => Self::Ref,
|
||||
Rule::new_px => Self::New,
|
||||
Rule::new_px => Self::New(
|
||||
pair.into_inner()
|
||||
.next()
|
||||
.map(|v| v.try_into().get())
|
||||
.transpose()?,
|
||||
),
|
||||
Rule::not_px => Self::Not,
|
||||
Rule::neg_px => Self::Neg,
|
||||
Rule::range_start_inc_px => Self::RangeInclusive,
|
||||
|
||||
Reference in New Issue
Block a user