fluidattacks-blends-domain 0.6.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
use crate::syntax::builders::switch_statement::build_switch_statement_node;
use crate::syntax::fields::c_sharp::switch_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, switch_statement::BODY)?;
    let value_id = args.required_field_alt(n_id, switch_statement::VALUE)?;
    build_switch_statement_node(args, n_id, body_id, value_id).map(Some)
}