Class constructor (optional)
This commit is contained in:
@@ -104,6 +104,7 @@ pub enum Prefix {
|
||||
Ref,
|
||||
RefMut,
|
||||
Deref,
|
||||
New,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
|
||||
@@ -167,11 +167,13 @@ prefix = {
|
||||
deref_px
|
||||
| mut_ref_px
|
||||
| ref_px
|
||||
| new_px
|
||||
}
|
||||
|
||||
deref_px = { "*" }
|
||||
mut_ref_px = { "&" ~ mutable }
|
||||
ref_px = { "&" }
|
||||
new_px = { "new" }
|
||||
|
||||
expr = {
|
||||
prefix* ~ primary ~ postfix*
|
||||
|
||||
@@ -480,6 +480,7 @@ impl From<pest::iterators::Pair<'_, Rule>> for Prefix {
|
||||
Rule::deref_px => Self::Deref,
|
||||
Rule::mut_ref_px => Self::RefMut,
|
||||
Rule::ref_px => Self::Ref,
|
||||
Rule::new_px => Self::New,
|
||||
_ => unimplemented!("{pair:#?}"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user