use alloc::vec::Vec;
use crate::syntax::builders::execution_block::build_execution_block_node;
use crate::syntax::readers::java::common::inner_children;
use crate::syntax::{SyntaxGraphArgs, SyntaxGraphError};
use crate::{CodeGraph, NodeId};
pub fn reader(
args: &mut SyntaxGraphArgs<'_>,
n_id: NodeId,
) -> Result<Option<NodeId>, SyntaxGraphError> {
let graph = args.ast_graph;
let c_ids: Vec<NodeId> = inner_children(graph, n_id)
.into_iter()
.filter(|c_id| graph.label_type(*c_id) != Some(";"))
.collect();
build_execution_block_node(args, n_id, &c_ids).map(Some)
}