Replace terminology "primary" with "call argument" and "parameter" with "secondary input"

This commit is contained in:
Keavon Chambers
2024-09-25 20:05:00 -07:00
parent f8c7ada572
commit c738b4a1f9
15 changed files with 142 additions and 128 deletions

View File

@@ -100,11 +100,11 @@ impl DynamicExecutor {
}
pub fn input_type(&self) -> Option<Type> {
self.typing_context.type_of(self.output).map(|node_io| node_io.input.clone())
self.typing_context.type_of(self.output).map(|node_io| node_io.call_argument.clone())
}
pub fn output_type(&self) -> Option<Type> {
self.typing_context.type_of(self.output).map(|node_io| node_io.output.clone())
self.typing_context.type_of(self.output).map(|node_io| node_io.return_value.clone())
}
pub fn document_node_types<'a>(&'a self, nodes: impl Iterator<Item = Path> + 'a) -> impl Iterator<Item = (Path, NodeTypes)> + 'a {
@@ -327,7 +327,7 @@ impl BorrowTree {
log::warn!("did not find type");
return false;
};
let inputs = [&node_io.input].into_iter().chain(&node_io.parameters).cloned().collect();
let inputs = [&node_io.call_argument].into_iter().chain(&node_io.inputs).cloned().collect();
let node_path = &proto_node.original_location.path.as_ref().unwrap_or(const { &vec![] });
@@ -337,7 +337,7 @@ impl BorrowTree {
id,
NodeTypes {
inputs,
output: node_io.output.clone(),
output: node_io.return_value.clone(),
},
);
let modified = *entry != update;

View File

@@ -60,11 +60,11 @@ macro_rules! register_node {
},
{
let node = <$path>::new($(
graphene_std::any::PanicNode::<(), $type>::new()
graphene_std::any::PanicNode::<(), $type>::new()
),*);
let params = vec![$(fn_type!((), $type)),*];
let mut node_io = <$path as NodeIO<'_, $input>>::to_node_io(&node, params);
node_io.input = concrete!(<$input as StaticType>::Static);
node_io.call_argument = concrete!(<$input as StaticType>::Static);
node_io
},
)
@@ -72,7 +72,7 @@ macro_rules! register_node {
}
macro_rules! async_node {
// TODO: we currently need to annotate the type here because the compiler would otherwise (correctly)
// assign a Pin<Box<dyn Future<Output=T>>> type to the node, which is not what we want for now.
// TODO: assign a Pin<Box<dyn Future<Output=T>>> type to the node, which is not what we want for now.
//
// This `params` variant of the macro wraps the normal `fn_params` variant and is used as a shorthand for writing `T` instead of `() => T`
($path:ty, input: $input:ty, params: [$($type:ty),*]) => {
@@ -91,13 +91,13 @@ macro_rules! async_node {
},
{
let node = <$path>::new($(
graphene_std::any::PanicNode::<$arg, core::pin::Pin<Box<dyn core::future::Future<Output = $type> + Send>>>::new()
graphene_std::any::PanicNode::<$arg, core::pin::Pin<Box<dyn core::future::Future<Output = $type> + Send>>>::new()
),*);
// TODO: Propagate the future type through the node graph
// let params = vec![$(Type::Fn(Box::new(concrete!(())), Box::new(Type::Future(Box::new(concrete!($type)))))),*];
let params = vec![$(fn_type!($arg, $type)),*];
let mut node_io = NodeIO::<'_, $input>::to_async_node_io(&node, params);
node_io.input = concrete!(<$input as StaticType>::Static);
node_io.call_argument = concrete!(<$input as StaticType>::Static);
node_io
},
)