fluidattacks-blends-domain 0.2.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
17
18
//! Counterpart of `blends/syntax/readers/yaml/comment.py`.

use crate::syntax::builders::comment::build_comment_node;
use crate::syntax::{SyntaxGraphArgs, SyntaxGraphError};
use crate::utilities::text_nodes::node_to_str;
use crate::NodeId;

#[expect(
    clippy::unnecessary_wraps,
    reason = "the signature must match the reader dispatch table"
)]
pub fn reader(
    args: &mut SyntaxGraphArgs<'_>,
    n_id: NodeId,
) -> Result<Option<NodeId>, SyntaxGraphError> {
    let comment = node_to_str(args.ast_graph, n_id);
    Ok(Some(build_comment_node(args, n_id, comment)))
}