fn parse_diagram( fields: &[Structure<'_>], unnamed_diagram_counter: &mut usize, unnamed_train_counter: &mut usize, ) -> Result<Diagram, String>