use crate::{
query::adj_ast,
syntax::{
builders::parenthesized_expression::build_parenthesized_expression_node, SyntaxGraphArgs,
SyntaxGraphError,
},
NodeId,
};
pub fn reader(
args: &mut SyntaxGraphArgs<'_>,
n_id: NodeId,
) -> Result<Option<NodeId>, SyntaxGraphError> {
let graph = args.ast_graph;
let Some(expr_id) = adj_ast(graph, n_id, Some(1), &[]).get(1).copied() else {
return Ok(None);
};
build_parenthesized_expression_node(args, n_id, expr_id).map(Some)
}