jit works

This commit is contained in:
2024-02-02 10:31:13 -08:00
parent 7ebb31b42f
commit 4ba196d2a6
21 changed files with 477 additions and 185 deletions

View File

@@ -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 {

View File

@@ -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)),
}
}