Allow any expression as constants
This is only a start. It compiles, but with a few TODOs left open. In particular, it doesn't currently handle constants depending on other constants or functions; nor does it hoist constants.
This commit is contained in:
@@ -4,8 +4,8 @@ use super::{
|
||||
};
|
||||
use crate::{
|
||||
ast::{
|
||||
Constant, DataTypeKey, FunctionAccessKey, Pattern, Span, TraceLevel, TypedArg,
|
||||
TypedAssignmentKind, TypedClause, TypedDataType, TypedPattern,
|
||||
DataTypeKey, FunctionAccessKey, Pattern, Span, TraceLevel, TypedArg, TypedAssignmentKind,
|
||||
TypedClause, TypedDataType, TypedPattern,
|
||||
},
|
||||
expr::TypedExpr,
|
||||
line_numbers::{LineColumn, LineNumbers},
|
||||
@@ -287,15 +287,6 @@ impl Default for CodeGenSpecialFuncs {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn constants_ir(literal: &Constant) -> AirTree {
|
||||
match literal {
|
||||
Constant::Int { value, .. } => AirTree::int(value),
|
||||
Constant::String { value, .. } => AirTree::string(value),
|
||||
Constant::ByteArray { bytes, .. } => AirTree::byte_array(bytes.clone()),
|
||||
Constant::CurvePoint { point, .. } => AirTree::curve(*point.as_ref()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_generic_variant_name(t: &Rc<Type>) -> String {
|
||||
let uplc_type = t.get_uplc_type();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user