mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Use ascii_case_insensitive_phf_map! in PropertyId::parse
This commit is contained in:
parent
33ef6f78e5
commit
2f996e34f5
7 changed files with 21 additions and 69 deletions
|
@ -33,7 +33,6 @@ def main():
|
|||
rust = render(template, product=product, data=properties, __file__=template)
|
||||
if output == "style-crate":
|
||||
write(os.environ["OUT_DIR"], "properties.rs", rust)
|
||||
write(os.environ["OUT_DIR"], "static_ids.txt", static_ids(properties))
|
||||
if product == "gecko":
|
||||
template = os.path.join(BASE, "gecko.mako.rs")
|
||||
rust = render(template, data=properties)
|
||||
|
@ -72,19 +71,6 @@ def write(directory, filename, content):
|
|||
open(os.path.join(directory, filename), "wb").write(content)
|
||||
|
||||
|
||||
def static_id_generator(properties):
|
||||
for kind, props in [("Longhand", properties.longhands),
|
||||
("Shorthand", properties.shorthands)]:
|
||||
for p in props:
|
||||
yield "%s\tStaticId::%s(%sId::%s)" % (p.name, kind, kind, p.camel_case)
|
||||
for alias in p.alias:
|
||||
yield "%s\tStaticId::%s(%sId::%s)" % (alias, kind, kind, p.camel_case)
|
||||
|
||||
|
||||
def static_ids(properties):
|
||||
return '\n'.join(static_id_generator(properties))
|
||||
|
||||
|
||||
def write_html(properties):
|
||||
properties = dict(
|
||||
(p.name, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue