MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / compile

Method compile

node-graph/graph-craft/src/graphene_compiler.rs:8–25  ·  view source on GitHub ↗
(&self, mut network: NodeNetwork)

Source from the content-addressed store, hash-verified

6
7impl Compiler {
8 pub fn compile(&self, mut network: NodeNetwork) -> impl Iterator<Item = Result<ProtoNetwork, String>> {
9 network.resolve_scope_inputs();
10 network.generate_node_paths(&[]);
11 let node_ids = network.nodes.keys().copied().collect::<Vec<_>>();
12 network.populate_dependants();
13 for id in node_ids {
14 network.flatten(id);
15 }
16 network.remove_redundant_passthrough_nodes();
17 // network.remove_dead_nodes(0);
18 let proto_networks = network.into_proto_networks();
19
20 proto_networks.map(move |mut proto_network| {
21 proto_network.insert_context_nullification_nodes()?;
22 proto_network.generate_stable_node_ids();
23 Ok(proto_network)
24 })
25 }
26 pub fn compile_single(&self, network: NodeNetwork) -> Result<ProtoNetwork, String> {
27 assert_eq!(network.exports.len(), 1, "Graph with multiple outputs not yet handled");
28 let Some(proto_network) = self.compile(network).next() else {

Callers 2

mainFunction · 0.80
compile_singleMethod · 0.80

Calls 9

resolve_scope_inputsMethod · 0.80
generate_node_pathsMethod · 0.80
populate_dependantsMethod · 0.80
flattenMethod · 0.80
into_proto_networksMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected