|
@@ -13,7 +13,7 @@
|
|
|
# See the COPYING file in the top-level directory.
|
|
|
"""
|
|
|
|
|
|
-from typing import List, Optional
|
|
|
+from typing import List, Optional, Sequence
|
|
|
|
|
|
from .common import (
|
|
|
c_enum_const,
|
|
@@ -139,7 +139,7 @@ def gen_struct_members(members: List[QAPISchemaObjectTypeMember]) -> str:
|
|
|
return ret
|
|
|
|
|
|
|
|
|
-def gen_object(name: str, ifcond: List[str],
|
|
|
+def gen_object(name: str, ifcond: Sequence[str],
|
|
|
base: Optional[QAPISchemaObjectType],
|
|
|
members: List[QAPISchemaObjectTypeMember],
|
|
|
variants: Optional[QAPISchemaVariants]) -> str:
|
|
@@ -307,7 +307,7 @@ def _gen_type_cleanup(self, name: str) -> None:
|
|
|
def visit_enum_type(self,
|
|
|
name: str,
|
|
|
info: Optional[QAPISourceInfo],
|
|
|
- ifcond: List[str],
|
|
|
+ ifcond: Sequence[str],
|
|
|
features: List[QAPISchemaFeature],
|
|
|
members: List[QAPISchemaEnumMember],
|
|
|
prefix: Optional[str]) -> None:
|
|
@@ -318,7 +318,7 @@ def visit_enum_type(self,
|
|
|
def visit_array_type(self,
|
|
|
name: str,
|
|
|
info: Optional[QAPISourceInfo],
|
|
|
- ifcond: List[str],
|
|
|
+ ifcond: Sequence[str],
|
|
|
element_type: QAPISchemaType) -> None:
|
|
|
with ifcontext(ifcond, self._genh, self._genc):
|
|
|
self._genh.preamble_add(gen_fwd_object_or_array(name))
|
|
@@ -328,7 +328,7 @@ def visit_array_type(self,
|
|
|
def visit_object_type(self,
|
|
|
name: str,
|
|
|
info: Optional[QAPISourceInfo],
|
|
|
- ifcond: List[str],
|
|
|
+ ifcond: Sequence[str],
|
|
|
features: List[QAPISchemaFeature],
|
|
|
base: Optional[QAPISchemaObjectType],
|
|
|
members: List[QAPISchemaObjectTypeMember],
|
|
@@ -351,7 +351,7 @@ def visit_object_type(self,
|
|
|
def visit_alternate_type(self,
|
|
|
name: str,
|
|
|
info: Optional[QAPISourceInfo],
|
|
|
- ifcond: List[str],
|
|
|
+ ifcond: Sequence[str],
|
|
|
features: List[QAPISchemaFeature],
|
|
|
variants: QAPISchemaVariants) -> None:
|
|
|
with ifcontext(ifcond, self._genh):
|