Skip to content

Commit 7af7667

Browse files
committed
parser: Read {a,}sync-func annotations
1 parent f4162ce commit 7af7667

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/library.rs

+2
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,8 @@ pub struct Function {
552552
pub doc: Option<String>,
553553
pub doc_deprecated: Option<String>,
554554
pub finish_func: Option<String>,
555+
pub async_func: Option<String>,
556+
pub sync_func: Option<String>,
555557
}
556558

557559
#[derive(Debug)]

src/parser.rs

+6
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,8 @@ impl Library {
596596
doc,
597597
doc_deprecated,
598598
finish_func: None,
599+
async_func: None,
600+
sync_func: None,
599601
})
600602
} else {
601603
Err(parser.fail("Missing <return-value> element"))
@@ -1019,6 +1021,8 @@ impl Library {
10191021
let is_method = kind == FunctionKind::Method;
10201022
let version = self.read_version(parser, ns_id, elem)?;
10211023
let deprecated_version = self.read_deprecated_version(parser, ns_id, elem)?;
1024+
let async_func = elem.attr("async-func").map(ToString::to_string);
1025+
let sync_func = elem.attr("sync-func").map(ToString::to_string);
10221026
let finish_func = c_identifier.and_then(|c_identifier| {
10231027
elem.attr("finish-func").map(|finish_func_name| {
10241028
format!(
@@ -1092,6 +1096,8 @@ impl Library {
10921096
doc,
10931097
doc_deprecated,
10941098
finish_func,
1099+
async_func,
1100+
sync_func,
10951101
})
10961102
} else {
10971103
Err(parser.fail_with_position(

0 commit comments

Comments
 (0)