Remove all our local patches to the WebIDL parser

All the tweaks we need can just be made through Configuration.py, and
[Abstract] is being submitted upstream by Ms2ger.
This commit is contained in:
Anthony Ramine 2015-10-16 23:21:29 +02:00
parent 432087c0ea
commit 06947965b1
6 changed files with 56 additions and 89 deletions

View file

@ -23,6 +23,7 @@ from WebIDL import (
from Configuration import (
MemberIsUnforgeable,
getModuleFromObject,
getTypesFromCallback,
getTypesFromDescriptor,
getTypesFromDictionary,
@ -920,7 +921,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
assert not type.treatNonObjectAsNull() or not type.treatNonCallableAsNull()
callback = type.unroll().callback
declType = CGGeneric('%s::%s' % (callback.module(), callback.identifier.name))
declType = CGGeneric('%s::%s' % (getModuleFromObject(callback), callback.identifier.name))
finalDeclType = CGTemplatedType("Rc", declType)
conversion = CGCallbackTempRoot(declType.define())
@ -1281,7 +1282,7 @@ def getRetvalDeclarationForType(returnType, descriptorProvider):
return result
if returnType.isCallback():
callback = returnType.unroll().callback
result = CGGeneric('Rc<%s::%s>' % (callback.module(), callback.identifier.name))
result = CGGeneric('Rc<%s::%s>' % (getModuleFromObject(callback), callback.identifier.name))
if returnType.nullable():
result = CGWrapper(result, pre="Option<", post=">")
return result
@ -5157,7 +5158,7 @@ class CGDictionary(CGThing):
@staticmethod
def makeModuleName(dictionary):
return dictionary.module()
return getModuleFromObject(dictionary)
def getMemberType(self, memberInfo):
member, info = memberInfo
@ -6056,8 +6057,8 @@ class GlobalGenRoots():
def Bindings(config):
descriptors = (set(d.name + "Binding" for d in config.getDescriptors(register=True)) |
set(d.module() for d in config.callbacks) |
set(d.module() for d in config.getDictionaries()))
set(getModuleFromObject(d) for d in config.callbacks) |
set(getModuleFromObject(d) for d in config.getDictionaries()))
curr = CGList([CGGeneric("pub mod %s;\n" % name) for name in sorted(descriptors)])
curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT)
return curr