Skip to content

Commit

Permalink
Added error checking and derivedFrom on registers
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilgardis committed Apr 28, 2017
1 parent fd65485 commit 54825e2
Show file tree
Hide file tree
Showing 5 changed files with 310 additions and 217 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ version = "0.5.0"

[dependencies]
xmltree = "0.3.2"
error-chain = "0.7.2"
2 changes: 1 addition & 1 deletion generate-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ EOF
fn $device() {
let xml = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/$device_path"));
svd::parse(xml);
svd::parse(xml).unwrap();
}
EOF
done
Expand Down
17 changes: 17 additions & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use xmltree;
use std::str;
use std::num;
error_chain! {
foreign_links {
XmlParseError(xmltree::ParseError);
StrParseBoolError(str::ParseBoolError);
NumParseIntError(num::ParseIntError);

}
errors {
MissingMandatory(t: String) {
description("mandatory element missing")
display("mandatory element missing: ´{}´", t)
}
}
}
Loading

0 comments on commit 54825e2

Please sign in to comment.