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

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from WebIDL import IDLInterface
from WebIDL import IDLExternalInterface, IDLInterface, WebIDLError
class Configuration:
@ -23,6 +23,11 @@ class Configuration:
self.interfaces = {}
self.maxProtoChainLength = 0
for thing in parseData:
# Servo does not support external interfaces.
if isinstance(thing, IDLExternalInterface):
raise WebIDLError("Servo does not support external interfaces.",
[thing.location])
# Some toplevel things are sadly types, and those have an
# isInterface that doesn't mean the same thing as IDLObject's
# isInterface()...
@ -345,6 +350,10 @@ class Descriptor(DescriptorProvider):
# Some utility methods
def getModuleFromObject(object):
return object.location.filename().split('/')[-1].split('.webidl')[0] + 'Binding'
def getTypesFromDescriptor(descriptor):
"""
Get all argument and return types for all members of the descriptor