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
17
18
//! Counterpart of `blends/syntax/builders/literal.py`.

use alloc::string::String;

use crate::syntax::SyntaxGraphArgs;
use crate::syntax::SyntaxNode;
use crate::NodeId;

pub fn build_literal_node(
    args: &mut SyntaxGraphArgs<'_>,
    n_id: NodeId,
    value: String,
    value_type: String,
) -> NodeId {
    args.syntax_graph
        .add_node(n_id, SyntaxNode::Literal { value, value_type });
    n_id
}