mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-03 19:01:06 +00:00
Add support for partial namespaces
This commit is contained in:
parent
a23fa03ad0
commit
df1342398d
@ -189,8 +189,7 @@ impl<'src> WebidlParse<'src, ()> for weedle::Definition<'src> {
|
|||||||
namespace.webidl_parse(program, first_pass, ())?
|
namespace.webidl_parse(program, first_pass, ())?
|
||||||
}
|
}
|
||||||
weedle::Definition::PartialNamespace(namespace) => {
|
weedle::Definition::PartialNamespace(namespace) => {
|
||||||
// TODO
|
namespace.webidl_parse(program, first_pass, ())?
|
||||||
warn!("Unsupported WebIDL definition: {:?}", self)
|
|
||||||
}
|
}
|
||||||
// TODO
|
// TODO
|
||||||
weedle::Definition::Callback(..)
|
weedle::Definition::Callback(..)
|
||||||
@ -832,6 +831,38 @@ impl<'src> WebidlParse<'src, ()> for weedle::NamespaceDefinition<'src> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'src> WebidlParse<'src, ()> for weedle::PartialNamespaceDefinition<'src> {
|
||||||
|
fn webidl_parse(
|
||||||
|
&'src self,
|
||||||
|
program: &mut backend::ast::Program,
|
||||||
|
first_pass: &FirstPassRecord<'src>,
|
||||||
|
(): (),
|
||||||
|
) -> Result<()> {
|
||||||
|
if util::is_chrome_only(&self.attributes) {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let rust_name = rust_ident(self.identifier.0.to_snake_case().as_str());
|
||||||
|
|
||||||
|
if !first_pass.namespaces.contains_key(self.identifier.0) {
|
||||||
|
warn!(
|
||||||
|
"Partial namespace {} missing non-partial namespace",
|
||||||
|
self.identifier.0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let namespace_names = NamespaceNames {
|
||||||
|
rust_name: &rust_name,
|
||||||
|
js_name: &self.identifier.0,
|
||||||
|
};
|
||||||
|
for member in &self.members.body {
|
||||||
|
member.webidl_parse(program, first_pass, namespace_names)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'src> WebidlParse<'src, &'src weedle::NamespaceDefinition<'src>> for ExtendedAttribute<'src> {
|
impl<'src> WebidlParse<'src, &'src weedle::NamespaceDefinition<'src>> for ExtendedAttribute<'src> {
|
||||||
fn webidl_parse(
|
fn webidl_parse(
|
||||||
&'src self,
|
&'src self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user