tools/spec: use more consistent block comment separators

This commit is contained in:
Danny Robson 2019-01-05 12:31:33 +11:00
parent e592afd8e0
commit 7aca56ce9e

View File

@ -130,7 +130,6 @@ class Placeholder(Type):
super().__init__(name) super().__init__(name)
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
class Unscoped(Type): class Unscoped(Type):
def __init__(self, name: str): def __init__(self, name: str):
@ -144,7 +143,6 @@ class Unscoped(Type):
return "\n".join(t.define(reg.types) for t in self.values) return "\n".join(t.define(reg.types) for t in self.values)
############################################################################### ###############################################################################
class Include(Type): class Include(Type):
def __init__(self, node): def __init__(self, node):
@ -159,6 +157,7 @@ class Include(Type):
return self.directive or "#include <%s>" % self.name return self.directive or "#include <%s>" % self.name
# -----------------------------------------------------------------------------
class Define(Type): class Define(Type):
def __init__(self, node): def __init__(self, node):
assert node.tag == 'type' assert node.tag == 'type'
@ -173,6 +172,7 @@ class Define(Type):
return self.directive return self.directive
###############################################################################
class Bitmask(Type): class Bitmask(Type):
def __init__(self, node): def __init__(self, node):
assert node.tag == 'type' assert node.tag == 'type'
@ -217,6 +217,7 @@ class Bitmask(Type):
} }
###############################################################################
class Handle(Type): class Handle(Type):
parents: List[str] parents: List[str]
type: str type: str
@ -263,6 +264,7 @@ class Handle(Type):
return False return False
###############################################################################
class Enum(Type): class Enum(Type):
def __init__(self, node): def __init__(self, node):
assert node.tag == 'type' assert node.tag == 'type'
@ -292,6 +294,7 @@ class Enum(Type):
} }
###############################################################################
class BaseType(AliasType): class BaseType(AliasType):
""" """
Represents fundamental types that aliases of system provided types and used Represents fundamental types that aliases of system provided types and used
@ -308,6 +311,7 @@ class BaseType(AliasType):
) )
###############################################################################
class FuncPointer(Type): class FuncPointer(Type):
def __init__(self, node): def __init__(self, node):
assert node.tag == 'type' assert node.tag == 'type'
@ -324,6 +328,7 @@ class FuncPointer(Type):
return self.text return self.text
###############################################################################
class POD(Type): class POD(Type):
def __init__(self, node): def __init__(self, node):
assert node.tag == 'type' assert node.tag == 'type'
@ -370,16 +375,19 @@ class POD(Type):
} }
# -----------------------------------------------------------------------------
class Struct(POD): class Struct(POD):
def __init__(self, node): def __init__(self, node):
super().__init__(node) super().__init__(node)
# -----------------------------------------------------------------------------
class Union(POD): class Union(POD):
def __init__(self, node): def __init__(self, node):
super().__init__(node) super().__init__(node)
###############################################################################
class Constant(Type): class Constant(Type):
def __init__(self, node, **kwargs): def __init__(self, node, **kwargs):
assert node.tag == 'enum' assert node.tag == 'enum'
@ -410,6 +418,7 @@ class Constant(Type):
} }
###############################################################################
class Command(Type): class Command(Type):
class Param(Type): class Param(Type):
def __init__(self, node, **kwargs): def __init__(self, node, **kwargs):
@ -484,6 +493,7 @@ class Command(Type):
return not self.is_instance(reg) return not self.is_instance(reg)
###############################################################################
class Require(object): class Require(object):
def __init__(self, root): def __init__(self, root):
self.values = [] self.values = []
@ -533,6 +543,7 @@ class Require(object):
return required return required
# -----------------------------------------------------------------------------
class Feature(Type): class Feature(Type):
def __init__(self, root): def __init__(self, root):
assert root.tag == 'feature' assert root.tag == 'feature'
@ -560,6 +571,7 @@ class Feature(Type):
return result return result
# -----------------------------------------------------------------------------
class Extension(Type): class Extension(Type):
def __init__(self, root): def __init__(self, root):
assert root.tag == 'extension' assert root.tag == 'extension'
@ -600,7 +612,6 @@ class Extension(Type):
return required return required
############################################################################### ###############################################################################
def ignore_node(types:Dict[str, Type], root): def ignore_node(types:Dict[str, Type], root):
pass pass