Prep the way for type casting.
This commit is contained in:
@@ -58,6 +58,7 @@ impl PartialEq for Statement {
|
||||
pub enum Expression {
|
||||
Value(Location, Value),
|
||||
Reference(Location, String),
|
||||
Cast(Location, String, Box<Expression>),
|
||||
Primitive(Location, String, Vec<Expression>),
|
||||
}
|
||||
|
||||
@@ -72,6 +73,10 @@ impl PartialEq for Expression {
|
||||
Expression::Reference(_, var2) => var1 == var2,
|
||||
_ => false,
|
||||
},
|
||||
Expression::Cast(_, t1, e1) => match other {
|
||||
Expression::Cast(_, t2, e2) => t1 == t2 && e1 == e2,
|
||||
_ => false,
|
||||
}
|
||||
Expression::Primitive(_, prim1, args1) => match other {
|
||||
Expression::Primitive(_, prim2, args2) => prim1 == prim2 && args1 == args2,
|
||||
_ => false,
|
||||
|
||||
Reference in New Issue
Block a user