def parse_xref_object(self) -> Tuple[(Union[(ASTNamespace, ASTDeclaration)], bool)]:
    pos = self.pos
    try:
        templatePrefix = self._parse_template_declaration_prefix(objectType='xref')
        name = self._parse_nested_name()
        self.skip_ws()
        self.skip_string('()')
        self.assert_end()
        templatePrefix = self._check_template_consistency(name, templatePrefix, fullSpecShorthand=True)
        res1 = ASTNamespace(name, templatePrefix)
        res1.objectType = 'xref'
        return (res1, True)
    except DefinitionError as e1:
        try:
            self.pos = pos
            res2 = self.parse_declaration('function', 'function')
            self.skip_ws()
            self.skip_string('()')
            self.assert_end()
            return (res2, False)
        except DefinitionError as e2:
            errs = []
            errs.append((e1, 'If shorthand ref'))
            errs.append((e2, 'If full function ref'))
            msg = 'Error in cross-reference.'
            raise self._make_multi_error(errs, msg)
def parse_xref_object(self) -> Tuple[(Union[(ASTNamespace, ASTDeclaration)], bool)]:
    pos = self.pos
    try:
        templatePrefix = self._parse_template_declaration_prefix(objectType='xref')
        name = self._parse_nested_name()
        self.skip_ws()
        self.skip_string('()')
        self.assert_end()
        templatePrefix = self._check_template_consistency(name, templatePrefix, fullSpecShorthand=True)
        res1 = ASTNamespace(name, templatePrefix)
        res1.objectType = 'xref'
        return (res1, True)
    except DefinitionError as e1:
        try:
            self.pos = pos
            res2 = self.parse_declaration('function', 'function')
            self.skip_ws()
            self.skip_string('()')
            self.assert_end()
            return (res2, False)
        except DefinitionError as e2:
            errs = []
            errs.append((e1, 'If shorthand ref'))
            errs.append((e2, 'If full function ref'))
            msg = 'Error in cross-reference.'
            raise self._make_multi_error(errs, msg)