use crate::syntax::builders::switch_statement::build_switch_statement_node;
use crate::syntax::fields::javascript::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)
}