stylo: Don't add boundary characters to the fixups specified in ServoBindings.toml

This allows adjusting the fixups for the patches in bug 1393230 when using
libclang 3.9.
This commit is contained in:
Emilio Cobos Álvarez 2017-09-07 15:37:43 +02:00
parent c68bc0c145
commit 86f4e22fc2
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -292,7 +292,7 @@ mod bindings {
}, },
}; };
for fixup in fixups.iter() { for fixup in fixups.iter() {
result = Regex::new(&format!(r"\b{}\b", fixup.pat)).unwrap().replace_all(&result, fixup.rep.as_str()) result = Regex::new(&fixup.pat).unwrap().replace_all(&result, &*fixup.rep)
.into_owned().into(); .into_owned().into();
} }
let bytes = result.into_bytes(); let bytes = result.into_bytes();
@ -426,7 +426,7 @@ mod bindings {
let servo = item["servo"].as_str().unwrap(); let servo = item["servo"].as_str().unwrap();
let gecko_name = gecko.rsplit("::").next().unwrap(); let gecko_name = gecko.rsplit("::").next().unwrap();
fixups.push(Fixup { fixups.push(Fixup {
pat: format!("root::{}", gecko), pat: format!("\\broot::{}\\b", gecko),
rep: format!("::gecko_bindings::structs::{}", gecko_name) rep: format!("::gecko_bindings::structs::{}", gecko_name)
}); });
builder.hide_type(gecko) builder.hide_type(gecko)