def _add_enumerator_to_parent(self, ast: ASTDeclaration) -> None:
    assert (ast.objectType == 'enumerator')
    symbol = ast.symbol
    assert symbol
    assert (symbol.identOrOp is not None)
    assert (symbol.templateParams is None)
    assert (symbol.templateArgs is None)
    parentSymbol = symbol.parent
    assert parentSymbol
    if (parentSymbol.parent is None):
        return
    parentDecl = parentSymbol.declaration
    if (parentDecl is None):
        return
    if (parentDecl.objectType != 'enum'):
        return
    if (parentDecl.directiveType != 'enum'):
        return
    targetSymbol = parentSymbol.parent
    s = targetSymbol.find_identifier(symbol.identOrOp, matchSelf=False, recurseInAnon=True, searchInSiblings=False)
    if (s is not None):
        return
    declClone = symbol.declaration.clone()
    declClone.enumeratorScopedSymbol = symbol
    Symbol(parent=targetSymbol, identOrOp=symbol.identOrOp, templateParams=None, templateArgs=None, declaration=declClone, docname=self.env.docname)
def _add_enumerator_to_parent(self, ast: ASTDeclaration) -> None:
    assert (ast.objectType == 'enumerator')
    symbol = ast.symbol
    assert symbol
    assert (symbol.identOrOp is not None)
    assert (symbol.templateParams is None)
    assert (symbol.templateArgs is None)
    parentSymbol = symbol.parent
    assert parentSymbol
    if (parentSymbol.parent is None):
        return
    parentDecl = parentSymbol.declaration
    if (parentDecl is None):
        return
    if (parentDecl.objectType != 'enum'):
        return
    if (parentDecl.directiveType != 'enum'):
        return
    targetSymbol = parentSymbol.parent
    s = targetSymbol.find_identifier(symbol.identOrOp, matchSelf=False, recurseInAnon=True, searchInSiblings=False)
    if (s is not None):
        return
    declClone = symbol.declaration.clone()
    declClone.enumeratorScopedSymbol = symbol
    Symbol(parent=targetSymbol, identOrOp=symbol.identOrOp, templateParams=None, templateArgs=None, declaration=declClone, docname=self.env.docname)