jit works
This commit is contained in:
@@ -154,6 +154,19 @@ impl PartialEq for Expression {
|
||||
}
|
||||
}
|
||||
|
||||
impl Expression {
|
||||
/// Get the location of the expression in the source file (if there is one).
|
||||
pub fn location(&self) -> &Location {
|
||||
match self {
|
||||
Expression::Value(loc, _) => loc,
|
||||
Expression::Reference(loc, _) => loc,
|
||||
Expression::Cast(loc, _, _) => loc,
|
||||
Expression::Primitive(loc, _, _) => loc,
|
||||
Expression::Block(loc, _) => loc,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A value from the source syntax
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum Value {
|
||||
|
||||
@@ -270,6 +270,7 @@ impl TryFrom<i64> for ConstantType {
|
||||
21 => Ok(ConstantType::I16),
|
||||
22 => Ok(ConstantType::I32),
|
||||
23 => Ok(ConstantType::I64),
|
||||
255 => Ok(ConstantType::Void),
|
||||
_ => Err(InvalidConstantType::Value(value)),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user