svd_parser/datatype.rs
1use super::*;
2use crate::svd::DataType;
3
4impl Parse for DataType {
5 type Object = Self;
6 type Error = SVDErrorAt;
7 type Config = Config;
8
9 fn parse(tree: &Node, _config: &Self::Config) -> Result<Self, Self::Error> {
10 let text = tree.get_text()?;
11
12 Self::parse_str(text).ok_or_else(|| SVDError::InvalidDatatype(text.into()).at(tree.id()))
13 }
14}