mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 20:41:24 +00:00
Introduce the wasm-bindgen-webidl frontend
This is still a work in progress. Parse WebIDL source text and convert it into wasm-bindgen AST, so that we can automatically emit bindings for the types and functions described in the WebIDL.
This commit is contained in:
21
crates/webidl/tests/all/lib.rs
Normal file
21
crates/webidl/tests/all/lib.rs
Normal file
@ -0,0 +1,21 @@
|
||||
extern crate proc_macro2;
|
||||
extern crate syn;
|
||||
extern crate wasm_bindgen_backend as backend;
|
||||
extern crate wasm_bindgen_webidl as wb_webidl;
|
||||
|
||||
pub fn assert_parse(webidl: &str, expected: backend::ast::Program) {
|
||||
let actual = wb_webidl::parse(webidl).expect("should parse the webidl source OK");
|
||||
assert_eq!(expected, actual);
|
||||
}
|
||||
|
||||
macro_rules! assert_parse {
|
||||
($test_name:ident, $webidl_source:expr, $expected_ast:expr) => {
|
||||
#[test]
|
||||
fn $test_name() {
|
||||
$crate::assert_parse($webidl_source, $expected_ast);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
mod event;
|
||||
mod simple;
|
Reference in New Issue
Block a user