Commit ca7d1e53 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

IDL compiler: Clean up Includes

Cleans up web_idl.Includes and completes its implementation
(by removing unused implementations).

Bug: 839389
Change-Id: I44cb8f04d1fdc34c6b7ddbded25f8d55193bda55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768597Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690284}
parent 45223332
......@@ -2,10 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import exceptions
from .composition_parts import Identifier
from .composition_parts import WithCodeGeneratorInfo
from .composition_parts import WithComponent
from .composition_parts import WithDebugInfo
from .identifier_ir_map import IdentifierIRMap
......@@ -14,46 +11,29 @@ from .identifier_ir_map import IdentifierIRMap
class Includes(WithComponent, WithDebugInfo):
"""https://heycam.github.io/webidl/#include"""
class IR(IdentifierIRMap.IR, WithCodeGeneratorInfo, WithComponent,
WithDebugInfo):
class IR(IdentifierIRMap.IR, WithComponent, WithDebugInfo):
def __init__(self,
interface_identifier,
mixin_identifier,
code_generator_info=None,
component=None,
debug_info=None):
assert isinstance(interface_identifier, Identifier)
assert isinstance(mixin_identifier, Identifier)
# Includes statements are treated similarly to partial
# definitions, and it's convenient for IdlCompiler that
# 'includes' are grouped by interface's identifier, i.e.
# a group of mixins are merged into the interface.
# So, we take the interface's identifier as this IR's
# identifier.
# Includes statements are treated similarly to partial definitions
# because it's convenient for IdlCompiler that 'includes' are
# grouped by interface's identifier, for example, a group of mixins
# are merged into an interface. So, the interface's identifier is
# turned into this IR's identifier.
IdentifierIRMap.IR.__init__(
self,
identifier=interface_identifier,
kind=IdentifierIRMap.IR.Kind.INCLUDES)
WithCodeGeneratorInfo.__init__(self, code_generator_info)
WithComponent.__init__(self, component)
WithDebugInfo.__init__(self, debug_info)
self.interafce_identifier = interface_identifier
self.mixin_identifier = mixin_identifier
@property
def interface(self):
"""
Returns the interface that includes the mixin.
@return Interface
"""
raise exceptions.NotImplementedError()
@property
def mixin(self):
"""
Returns the interface mixin that is included by the other.
@return Interface
"""
raise exceptions.NotImplementedError()
# Includes are not exposed publicly so far.
__init__ = None
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment