Skip to content

Commit

Permalink
Merge pull request #804 from EPashkin/alias_doc_deprecated
Browse files Browse the repository at this point in the history
Parse "doc-deprecated" tag in alias
  • Loading branch information
EPashkin committed Jul 3, 2019
2 parents f9ec115 + 57fbc02 commit a080a17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ pub struct Alias {
pub typ: TypeId,
pub target_c_type: String,
pub doc: Option<String>,
pub doc_deprecated: Option<String>,
}

#[derive(Debug)]
Expand Down
3 changes: 3 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ impl Library {

let mut inner = None;
let mut doc = None;
let mut doc_deprecated = None;

parser.elements(|parser, elem| match elem.name() {
"source-position" => parser.ignore_element(),
Expand All @@ -785,6 +786,7 @@ impl Library {
Ok(())
}
"doc" => parser.text().map(|t| doc = Some(t)),
"doc-deprecated" => parser.text().map(|t| doc_deprecated = Some(t)),
"attribute" => parser.ignore_element(),
_ => Err(parser.unexpected_element(elem)),
})?;
Expand All @@ -796,6 +798,7 @@ impl Library {
typ,
target_c_type: c_type,
doc,
doc_deprecated,
});
self.add_type(ns_id, alias_name, typ);
Ok(())
Expand Down

0 comments on commit a080a17

Please sign in to comment.