Class constructor (optional)

This commit is contained in:
2026-05-05 20:11:43 +02:00
parent 8bb5dc3584
commit 9e5d030b0c
5 changed files with 29 additions and 2 deletions
+1
View File
@@ -104,6 +104,7 @@ pub enum Prefix {
Ref,
RefMut,
Deref,
New,
}
#[derive(Debug, Clone, Serialize)]
+2
View File
@@ -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*
+1
View File
@@ -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:#?}"),
}
}