File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
88## [ Unreleased]
99
10+ ## [ v0.8.1] - 2019-11-03
11+
12+ - Fix: make ` derive_from ` module public
13+ - Fix: enumerated_values empty check
14+
1015## [ v0.8.0] - 2019-11-03
1116
1217- [ breaking-change] ` RegisterClusterArrayInfo ` renamed on ` DimElement `
@@ -106,7 +111,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
106111- Initial SVD parser
107112- A ` parse ` utility function to parse the contents of a SVD file (XML)
108113
109- [ Unreleased ] : https://github.com/rust-embedded/svd/compare/v0.8.0...HEAD
114+ [ Unreleased ] : https://github.com/rust-embedded/svd/compare/v0.8.1...HEAD
115+ [ v0.8.1 ] : https://github.com/rust-embedded/svd/compare/v0.8.0...v0.8.1
110116[ v0.8.0 ] : https://github.com/rust-embedded/svd/compare/v0.7.0...v0.8.0
111117[ v0.7.0 ] : https://github.com/rust-embedded/svd/compare/v0.6.0...v0.7.0
112118[ v0.6.0 ] : https://github.com/rust-embedded/svd/compare/v0.5.2...v0.6.0
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ use encode::Encode;
4949pub mod types;
5050
5151#[ cfg( feature = "derive-from" ) ]
52- mod derive_from;
52+ pub mod derive_from;
5353#[ cfg( feature = "derive-from" ) ]
5454pub use derive_from:: DeriveFrom ;
5555
Original file line number Diff line number Diff line change @@ -31,11 +31,13 @@ impl Parse for EnumeratedValues {
3131
3232 fn parse ( tree : & Element ) -> Result < EnumeratedValues , SVDError > {
3333 assert_eq ! ( tree. name, "enumeratedValues" ) ;
34+ let derived_from = tree. attributes . get ( "derivedFrom" ) . map ( |s| s. to_owned ( ) ) ;
35+ let is_derived = derived_from. is_some ( ) ;
3436
3537 Ok ( EnumeratedValues {
3638 name : tree. get_child_text_opt ( "name" ) ?,
3739 usage : parse:: optional :: < Usage > ( "usage" , tree) ?,
38- derived_from : tree . attributes . get ( "derivedFrom" ) . map ( |s| s . to_owned ( ) ) ,
40+ derived_from,
3941 values : {
4042 let values: Result < Vec < _ > , _ > = tree
4143 . children
@@ -62,7 +64,7 @@ impl Parse for EnumeratedValues {
6264 } )
6365 . collect ( ) ;
6466 let values = values?;
65- if values. is_empty ( ) {
67+ if values. is_empty ( ) && !is_derived {
6668 return Err ( SVDErrorKind :: EmptyTag ( tree. clone ( ) , tree. name . clone ( ) ) . into ( ) ) ;
6769 }
6870 values
You can’t perform that action at this time.
0 commit comments