diff options
Diffstat (limited to 'sphinx/domains/cpp.py')
-rw-r--r-- | sphinx/domains/cpp.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index c8625e81d..30772c105 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -776,7 +776,7 @@ class ASTNestedName(ASTBase): assert len(self.names) == 1 assert not self.templates[0] self.names[0].describe_signature(signode, 'param', env, '', symbol) - elif mode == 'markType' or mode == 'lastIsName' or mode == 'markName': + elif mode in ('markType', 'lastIsName', 'markName'): # Each element should be a pending xref targeting the complete # prefix. however, only the identifier part should be a link, such # that template args can be a link as well. @@ -5385,7 +5385,7 @@ class DefinitionParser(BaseParser): postFixes: List[ASTPostfixOp] = [] while True: self.skip_ws() - if prefixType in ['expr', 'cast', 'typeid']: + if prefixType in ('expr', 'cast', 'typeid'): if self.skip_string_and_ws('['): expr = self._parse_expression() self.skip_ws() @@ -7781,7 +7781,7 @@ class CPPDomain(Domain): typ: str, target: str, node: pending_xref, contnode: Element) -> Tuple[Optional[Element], Optional[str]]: # add parens again for those that could be functions - if typ == 'any' or typ == 'func': + if typ in ('any', 'func'): target += '()' parser = DefinitionParser(target, location=node, config=env.config) try: @@ -7902,7 +7902,7 @@ class CPPDomain(Domain): if (env.config.add_function_parentheses and typ == 'func' and title.endswith('operator()')): addParen += 1 - if ((typ == 'any' or typ == 'func') and + if (typ in ('any', 'func') and title.endswith('operator') and displayName.endswith('operator()')): addParen += 1 |