Code gen now handles expecting on validator args in the air stack.

Thus allowing us to use code gen created functions to expect on data types including recursive ones.
Some minor tweaks to the air.
Added a uplc optimization for later.
This commit is contained in:
Kasey White
2023-04-07 02:25:18 -04:00
committed by Kasey
parent 4e4eed13e1
commit f8483da4e0
5 changed files with 147 additions and 94 deletions

View File

@@ -5,7 +5,7 @@ use indexmap::IndexSet;
use uplc::{builder::EXPECT_ON_LIST, builtins::DefaultFunction};
use crate::{
ast::{Arg, Span},
ast::Span,
builtins::{data, list, void},
tipo::{Type, ValueConstructor, ValueConstructorVariant},
IdGenerator,
@@ -701,12 +701,11 @@ impl AirStack {
self.merge_child(body_stack);
}
pub fn validator(&mut self, params: Vec<Arg<Arc<Type>>>) {
pub fn noop(&mut self) {
self.new_scope();
self.air.push(Air::Validator {
self.air.push(Air::NoOp {
scope: self.scope.clone(),
params,
});
}