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/).
7
7
8
8
## [ Unreleased]
9
9
10
+ ## [ v0.8.1] - 2019-11-03
11
+
12
+ - Fix: make ` derive_from ` module public
13
+ - Fix: enumerated_values empty check
14
+
10
15
## [ v0.8.0] - 2019-11-03
11
16
12
17
- [ breaking-change] ` RegisterClusterArrayInfo ` renamed on ` DimElement `
@@ -106,7 +111,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
106
111
- Initial SVD parser
107
112
- A ` parse ` utility function to parse the contents of a SVD file (XML)
108
113
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
110
116
[ v0.8.0 ] : https://github.com/rust-embedded/svd/compare/v0.7.0...v0.8.0
111
117
[ v0.7.0 ] : https://github.com/rust-embedded/svd/compare/v0.6.0...v0.7.0
112
118
[ 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;
49
49
pub mod types;
50
50
51
51
#[ cfg( feature = "derive-from" ) ]
52
- mod derive_from;
52
+ pub mod derive_from;
53
53
#[ cfg( feature = "derive-from" ) ]
54
54
pub use derive_from:: DeriveFrom ;
55
55
Original file line number Diff line number Diff line change @@ -31,11 +31,13 @@ impl Parse for EnumeratedValues {
31
31
32
32
fn parse ( tree : & Element ) -> Result < EnumeratedValues , SVDError > {
33
33
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 ( ) ;
34
36
35
37
Ok ( EnumeratedValues {
36
38
name : tree. get_child_text_opt ( "name" ) ?,
37
39
usage : parse:: optional :: < Usage > ( "usage" , tree) ?,
38
- derived_from : tree . attributes . get ( "derivedFrom" ) . map ( |s| s . to_owned ( ) ) ,
40
+ derived_from,
39
41
values : {
40
42
let values: Result < Vec < _ > , _ > = tree
41
43
. children
@@ -62,7 +64,7 @@ impl Parse for EnumeratedValues {
62
64
} )
63
65
. collect ( ) ;
64
66
let values = values?;
65
- if values. is_empty ( ) {
67
+ if values. is_empty ( ) && !is_derived {
66
68
return Err ( SVDErrorKind :: EmptyTag ( tree. clone ( ) , tree. name . clone ( ) ) . into ( ) ) ;
67
69
}
68
70
values
You can’t perform that action at this time.
0 commit comments