Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse "doc-deprecated" tag in alias #804

Merged
merged 1 commit into from Jul 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/library.rs
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
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