mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-12-06 08:13:40 -10:00
Identify conversion nodes via node macro annotations (#5083)
Flag adapter nodes and register them by identifier
This commit is contained in:
1 parent
c0778752ab
commit
1300b4f92a
6 files changed
+102
-35
No files matched your search
@@ -29,6 +29,17 @@ pub struct NodeFlags {
|
||||
pub forwards_input: bool,
|
||||
pub inject_scope: bool,
|
||||
pub asynchronous: bool,
|
||||
/// Whether type resolution may insert this node on an edge, from `#[node_macro::node(adapter(...))]`.
|
||||
pub adapter: Option<AdapterKind>,
|
||||
}
|
||||
|
||||
/// How an adapter node changes the wire it is inserted on.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum AdapterKind {
|
||||
/// Converts the wire's element into another element type.
|
||||
Conversion,
|
||||
/// Changes the wire's rank, like raising an `Item` onto a `List`.
|
||||
Rank,
|
||||
}
|
||||
|
||||
// Translation struct between macro and definition
|
||||
|
||||
Reference in new issue
Block a user