Skip to content

Commit 211ae3e

Browse files
committed
Parse a couple more register attributes, including derivedFrom
refs: #21
1 parent 0d4918e commit 211ae3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ pub struct ClusterInfo {
239239
#[derive(Clone, Debug)]
240240
pub struct RegisterInfo {
241241
pub name: String,
242+
pub alternate_group: Option<String>,
242243
pub alternate_register: Option<String>,
244+
pub derived_from: Option<String>,
243245
pub description: String,
244246
pub address_offset: u32,
245247
pub size: Option<u32>,
@@ -352,7 +354,9 @@ impl RegisterInfo {
352354
fn parse(tree: &Element) -> RegisterInfo {
353355
RegisterInfo {
354356
name: try!(tree.get_child_text("name")),
357+
alternate_group: tree.get_child_text("alternateGroup"),
355358
alternate_register: tree.get_child_text("alternateRegister"),
359+
derived_from: tree.attributes.get("derivedFrom").map(|s| s.to_owned()),
356360
description: try!(tree.get_child_text("description")),
357361
address_offset: {
358362
try!(parse::u32(try!(tree.get_child("addressOffset"))))

0 commit comments

Comments
 (0)