mirror of
https://github.com/servo/servo.git
synced 2025-07-25 00:00:20 +01:00
Codegen support multiple interfaces in single webidl file & WebGPU single webidl (#30448)
* Codegen support multiple interfaces in single webidl file * Merge GPU*.webidl into WebGPU.webidl * Update gpu files to use WebGPUBinding module file
This commit is contained in:
parent
ebd41d4101
commit
ddc47aa56b
73 changed files with 1267 additions and 1428 deletions
|
@ -76,6 +76,13 @@ def toBindingModuleFile(arg):
|
|||
return re.sub("((_workers)?$)", "Binding\\1", MakeNativeName(arg))
|
||||
|
||||
|
||||
def toBindingModuleFileFromDescriptor(desc):
|
||||
if desc.maybeGetSuperModule() is not None:
|
||||
return toBindingModuleFile(desc.maybeGetSuperModule())
|
||||
else:
|
||||
return toBindingModuleFile(desc.name)
|
||||
|
||||
|
||||
def stripTrailingWhitespace(text):
|
||||
tail = '\n' if text.endswith('\n') else ''
|
||||
lines = text.splitlines()
|
||||
|
@ -8068,8 +8075,8 @@ class GlobalGenRoots():
|
|||
def InterfaceObjectMapData(config):
|
||||
pairs = []
|
||||
for d in config.getDescriptors(hasInterfaceObject=True, isInline=False):
|
||||
binding_mod = toBindingModuleFileFromDescriptor(d)
|
||||
binding_ns = toBindingNamespace(d.name)
|
||||
binding_mod = toBindingModuleFile(d.name)
|
||||
pairs.append((d.name, binding_mod, binding_ns))
|
||||
for alias in d.interface.legacyWindowAliases:
|
||||
pairs.append((alias, binding_mod, binding_ns))
|
||||
|
@ -8142,7 +8149,7 @@ class GlobalGenRoots():
|
|||
return getModuleFromObject(d).split('::')[-1]
|
||||
|
||||
descriptors = config.getDescriptors(register=True, isIteratorInterface=False)
|
||||
descriptors = (set(toBindingModuleFile(d.name) for d in descriptors)
|
||||
descriptors = (set(toBindingModuleFile(d.name) for d in descriptors if d.maybeGetSuperModule() is None)
|
||||
| set(leafModule(d) for d in config.callbacks)
|
||||
| set(leafModule(d) for d in config.getDictionaries()))
|
||||
curr = CGList([CGGeneric("pub mod %s;\n" % name) for name in sorted(descriptors)])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue