Prefix dereferences as lvalues

This commit is contained in:
2023-08-13 19:29:50 -05:00
parent 190ceb5f13
commit 1de091f269
4 changed files with 87 additions and 54 deletions
+5 -11
View File
@@ -79,26 +79,20 @@ pub struct Assignment {
}
#[derive(PartialEq, Clone, Debug)]
pub struct Lvalue {
pub name: String,
pub subscripts: Vec<Suffix>,
pub enum Lvalue {
Expr(BoxExpr),
Name(String, Vec<Suffix>)
}
impl From<&str> for Lvalue {
fn from(name: &str) -> Self {
Self {
name: String::from(name),
subscripts: vec![],
}
Self::Name(String::from(name), vec![])
}
}
impl From<String> for Lvalue {
fn from(name: String) -> Self {
Self {
name,
subscripts: vec![],
}
Self::Name(name, vec![])
}
}