fluidattacks-blends-domain 0.6.1

Blends functional core: pure AST graph to syntax graph (no_std)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Cfg builder that branches into every child path.

use crate::query::adj_ast;
use crate::syntax::cfg::{SyntaxCfgArgs, SyntaxCfgError};
use crate::NodeId;

pub fn build(
    args: &mut SyntaxCfgArgs<'_>,
    n_id: NodeId,
    nxt_id: Option<NodeId>,
) -> Result<NodeId, SyntaxCfgError> {
    for c_id in adj_ast(args.graph, n_id, None, &[]) {
        let built = args.generic(c_id, nxt_id)?;
        args.graph.add_cfg_edge(n_id, built);
    }
    Ok(n_id)
}