Skip to content

Commit

Permalink
parser: Read {a,}sync-func annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
A6GibKm authored and bilelmoussaoui committed Jun 2, 2024
1 parent ef419c1 commit d26d8f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ pub struct Function {
pub get_property: Option<String>,
pub set_property: Option<String>,
pub finish_func: Option<String>,
pub async_func: Option<String>,
pub sync_func: Option<String>,
}

#[derive(Debug)]
Expand Down
6 changes: 6 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ impl Library {
get_property: None,
set_property: None,
finish_func: None,
async_func: None,
sync_func: None,
})
} else {
Err(parser.fail("Missing <return-value> element"))
Expand Down Expand Up @@ -1031,6 +1033,8 @@ impl Library {
)
})
});
let async_func = elem.attr("async-func").map(ToString::to_string);
let sync_func = elem.attr("sync-func").map(ToString::to_string);

let mut params = Vec::new();
let mut ret = None;
Expand Down Expand Up @@ -1123,6 +1127,8 @@ impl Library {
get_property,
set_property,
finish_func,
async_func,
sync_func,
})
} else {
Err(parser.fail_with_position(
Expand Down

0 comments on commit d26d8f6

Please sign in to comment.