fluidattacks-blends-domain 0.3.0

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
use crate::syntax::{SyntaxGraphArgs, SyntaxGraphError, SyntaxNode};
use crate::NodeId;

pub fn build_parenthesized_expression_node(
    args: &mut SyntaxGraphArgs<'_>,
    n_id: NodeId,
    expr_id: NodeId,
) -> Result<NodeId, SyntaxGraphError> {
    args.syntax_graph
        .add_node(n_id, SyntaxNode::ParenthesizedExpression);

    let built = args.generic(expr_id)?;
    args.syntax_graph.add_ast_edge(n_id, built);

    Ok(n_id)
}