C++, minor formatting

This commit is contained in:
Jakob Lykke Andersen 2022-03-12 20:05:26 +01:00
parent 926fab0a01
commit 9362df53be
2 changed files with 3 additions and 6 deletions

View File

@ -3370,8 +3370,7 @@ class ASTClass(ASTBase):
class ASTUnion(ASTBase):
def __init__(self, name: ASTNestedName,
attrs: List[ASTAttribute]) -> None:
def __init__(self, name: ASTNestedName, attrs: List[ASTAttribute]) -> None:
self.name = name
self.attrs = attrs
@ -3397,8 +3396,7 @@ class ASTUnion(ASTBase):
class ASTEnum(ASTBase):
def __init__(self, name: ASTNestedName, scoped: str,
underlyingType: ASTType,
def __init__(self, name: ASTNestedName, scoped: str, underlyingType: ASTType,
attrs: List[ASTAttribute]) -> None:
self.name = name
self.scoped = scoped

View File

@ -996,10 +996,9 @@ def test_domain_cpp_ast_attributes():
# position: parameters and qualifiers
check('function', 'void f() [[attr1]] [[attr2]]', {1: 'f', 2: '1fv'})
# position: class
# position: class, union, enum
check('class', '{key}[[nodiscard]] Foo', {1: 'Foo', 2: '3Foo'}, key='class')
check('union', '{key}[[nodiscard]] Foo', {1: None, 2: '3Foo'}, key='union')
# position: enum
check('enum', '{key}[[nodiscard]] Foo', {1: None, 2: '3Foo'}, key='enum')