mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-07-22 23:51:57 +00:00
webidl: add support for typedefs
This commit is contained in:
crates
@@ -59,6 +59,9 @@ impl ToTokens for ast::Program {
|
||||
for e in self.enums.iter() {
|
||||
e.to_tokens(tokens);
|
||||
}
|
||||
for a in self.type_aliases.iter() {
|
||||
a.to_tokens(tokens);
|
||||
}
|
||||
|
||||
// Generate a static which will eventually be what lives in a custom section
|
||||
// of the wasm executable. For now it's just a plain old static, but we'll
|
||||
@@ -823,3 +826,15 @@ impl ToTokens for ast::ImportStatic {
|
||||
}).to_tokens(into);
|
||||
}
|
||||
}
|
||||
|
||||
impl ToTokens for ast::TypeAlias {
|
||||
fn to_tokens(&self, into: &mut TokenStream) {
|
||||
let vis = &self.vis;
|
||||
let dest = &self.dest;
|
||||
let src = &self.src;
|
||||
(quote! {
|
||||
#[allow(non_camel_case_types)]
|
||||
#vis type #dest = #src;
|
||||
}).to_tokens(into);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user