Skip to content

Update weedle: use special instead of specials #837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/webidl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ proc-macro2 = "0.4.8"
quote = '0.6'
syn = { version = '0.15', features = ['full'] }
wasm-bindgen-backend = { version = "=0.2.21", path = "../backend" }
weedle = "0.7"
weedle = "0.8"
18 changes: 7 additions & 11 deletions crates/webidl/src/first_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,6 @@ impl<'src> FirstPass<'src, &'src str> for weedle::interface::InterfaceMember<'sr

impl<'src> FirstPass<'src, &'src str> for weedle::interface::OperationInterfaceMember<'src> {
fn first_pass(&'src self, record: &mut FirstPassRecord<'src>, self_name: &'src str) -> Result<()> {
if self.specials.len() > 1 {
warn!("Unsupported webidl operation: {:?}", self);
return Ok(())
}
let is_static = match self.modifier {
Some(StringifierOrStatic::Stringifier(_)) => {
warn!("Unsupported webidl stringifier: {:?}", self);
Expand All @@ -461,13 +457,13 @@ impl<'src> FirstPass<'src, &'src str> for weedle::interface::OperationInterfaceM
};

let mut ids = vec![OperationId::Operation(self.identifier.map(|s| s.0))];
for special in self.specials.iter() {
ids.push(match special {
Special::Getter(_) => OperationId::IndexingGetter,
Special::Setter(_) => OperationId::IndexingSetter,
Special::Deleter(_) => OperationId::IndexingDeleter,
Special::LegacyCaller(_) => continue,
});
if let Some(special) = self.special {
match special {
Special::Getter(_) => ids.push(OperationId::IndexingGetter),
Special::Setter(_) => ids.push(OperationId::IndexingSetter),
Special::Deleter(_) => ids.push(OperationId::IndexingDeleter),
Special::LegacyCaller(_) => {},
};
}
first_pass_operation(
record,
Expand Down