fluidattacks-blends-domain 0.3.0

Blends functional core: pure AST graph to syntax graph (no_std)
Documentation
//! Counterpart of `blends/syntax/builders/file.py` (the `StackGraph` module-path
//! branch is excluded: the migration covers only AST, Syntax and CFG).

use crate::syntax::SyntaxNode;
use crate::syntax::{SyntaxGraphArgs, SyntaxGraphError};
use crate::NodeId;

pub fn build_file_node(
    args: &mut SyntaxGraphArgs<'_>,
    n_id: NodeId,
    c_ids: &[NodeId],
) -> Result<NodeId, SyntaxGraphError> {
    args.syntax_graph.add_node(n_id, SyntaxNode::File);

    for c_id in c_ids {
        let built = args.generic(*c_id)?;
        args.syntax_graph.add_ast_edge(n_id, built);
    }

    Ok(n_id)
}