fluidattacks-blends-domain 0.6.0

Blends functional core: pure AST graph to syntax graph (no_std)
Documentation
use crate::syntax::builders::for_statement::build_for_statement_node;
use crate::syntax::fields::python::for_statement;
use crate::syntax::{SyntaxGraphArgs, SyntaxGraphError};
use crate::NodeId;

pub fn reader(
    args: &mut SyntaxGraphArgs<'_>,
    n_id: NodeId,
) -> Result<Option<NodeId>, SyntaxGraphError> {
    let body_id = args.required_field_alt(n_id, for_statement::BODY)?;
    let var_node = args.required_field_alt(n_id, for_statement::LEFT)?;
    let condition_node = args.required_field_alt(n_id, for_statement::RIGHT)?;
    build_for_statement_node(
        args,
        n_id,
        Some(var_node),
        Some(condition_node),
        None,
        body_id,
    )
    .map(Some)
}