Not prefix
This commit is contained in:
@@ -115,6 +115,7 @@ pub enum Prefix {
|
||||
RefMut,
|
||||
Deref,
|
||||
New,
|
||||
Not,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
|
||||
@@ -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* }
|
||||
|
||||
|
||||
@@ -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:#?}"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +164,7 @@ impl GetRust for Prefix {
|
||||
Self::Deref => "*",
|
||||
Self::Ref => "&",
|
||||
Self::RefMut => "&mut ",
|
||||
Self::Not => "!",
|
||||
Self::New => "",
|
||||
}
|
||||
.to_string()
|
||||
|
||||
Reference in New Issue
Block a user