Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bb22359

Browse files
committedJun 2, 2024··
parser: Read {a,}sync-func annotations
1 parent 20e8e1e commit bb22359

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
@@ -556,6 +556,8 @@ pub struct Function {
556556
pub get_property: Option<String>,
557557
pub set_property: Option<String>,
558558
pub finish_func: Option<String>,
559+
pub async_func: Option<String>,
560+
pub sync_func: Option<String>,
559561
}
560562

561563
#[derive(Debug)]

‎src/parser.rs

+6
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,8 @@ impl Library {
598598
get_property: None,
599599
set_property: None,
600600
finish_func: None,
601+
async_func: None,
602+
sync_func: None,
601603
})
602604
} else {
603605
Err(parser.fail("Missing <return-value> element"))
@@ -1031,6 +1033,8 @@ impl Library {
10311033
)
10321034
})
10331035
});
1036+
let async_func = elem.attr("async-func").map(ToString::to_string);
1037+
let sync_func = elem.attr("sync-func").map(ToString::to_string);
10341038

10351039
let mut params = Vec::new();
10361040
let mut ret = None;
@@ -1123,6 +1127,8 @@ impl Library {
11231127
get_property,
11241128
set_property,
11251129
finish_func,
1130+
async_func,
1131+
sync_func,
11261132
})
11271133
} else {
11281134
Err(parser.fail_with_position(

0 commit comments

Comments
 (0)
Please sign in to comment.