Not prefix

This commit is contained in:
2026-05-05 23:03:31 +02:00
parent 393830f235
commit a13bba4d02
4 changed files with 5 additions and 0 deletions
+1
View File
@@ -115,6 +115,7 @@ pub enum Prefix {
RefMut,
Deref,
New,
Not,
}
#[derive(Debug, Clone, Serialize)]
+2
View File
@@ -172,12 +172,14 @@ prefix = {
| mut_ref_px
| ref_px
| new_px
| not_px
}
deref_px = { "*" }
mut_ref_px = { "&" ~ mutable }
ref_px = { "&" }
new_px = { "new" }
not_px = { "!" }
prefix_list = { prefix* }
+1
View File
@@ -403,6 +403,7 @@ impl From<pest::iterators::Pair<'_, Rule>> for Prefix {
Rule::mut_ref_px => Self::RefMut,
Rule::ref_px => Self::Ref,
Rule::new_px => Self::New,
Rule::not_px => Self::Not,
_ => unimplemented!("{pair:#?}"),
}
}
+1
View File
@@ -164,6 +164,7 @@ impl GetRust for Prefix {
Self::Deref => "*",
Self::Ref => "&",
Self::RefMut => "&mut ",
Self::Not => "!",
Self::New => "",
}
.to_string()