Derive codegen node-kind predicates from the intent IR

This commit is contained in:
Dennis Kobert
2026-08-13 23:09:48 +00:00
parent 010785d8db
commit c82093f153
3 changed files with 42 additions and 37 deletions

View File

@@ -141,12 +141,12 @@ pub(crate) fn has_lazy_reads(parsed: &ParsedNodeFn) -> bool {
/// The value inputs of a routing node (every regular field that is not a
/// routing source), with their indices into the regular fields.
pub(crate) fn routing_value_indices(regular_fields: &[&ParsedField], routing: &RoutingIo) -> Vec<usize> {
pub(crate) fn routing_value_indices(regular_fields: &[&ParsedField], generic: &Ident) -> Vec<usize> {
regular_fields
.iter()
.enumerate()
.filter(|(_, field)| match &field.ty {
ParsedFieldType::Regular(RegularParsedField { ty, .. }) => !matches!(ty, Type::Path(path) if path.path.get_ident() == Some(&routing.generic)),
ParsedFieldType::Regular(RegularParsedField { ty, .. }) => !matches!(ty, Type::Path(path) if path.path.get_ident() == Some(generic)),
ParsedFieldType::Node(_) => false,
})
.map(|(index, _)| index)