mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
parent
cbefc01b73
commit
89a6d41ed0
2
CHANGES
2
CHANGES
@ -22,6 +22,8 @@ Bugs fixed
|
|||||||
- sphinx.application.CONFIG_FILENAME
|
- sphinx.application.CONFIG_FILENAME
|
||||||
- :confval:`viewcode_import`
|
- :confval:`viewcode_import`
|
||||||
|
|
||||||
|
* #6208: C++, properly parse full xrefs that happen to have a short xref as prefix.
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -6391,6 +6391,7 @@ class DefinitionParser:
|
|||||||
# if there are '()' left, just skip them
|
# if there are '()' left, just skip them
|
||||||
self.skip_ws()
|
self.skip_ws()
|
||||||
self.skip_string('()')
|
self.skip_string('()')
|
||||||
|
self.assert_end()
|
||||||
templatePrefix = self._check_template_consistency(name, templatePrefix,
|
templatePrefix = self._check_template_consistency(name, templatePrefix,
|
||||||
fullSpecShorthand=True)
|
fullSpecShorthand=True)
|
||||||
res1 = ASTNamespace(name, templatePrefix)
|
res1 = ASTNamespace(name, templatePrefix)
|
||||||
@ -6403,6 +6404,7 @@ class DefinitionParser:
|
|||||||
# if there are '()' left, just skip them
|
# if there are '()' left, just skip them
|
||||||
self.skip_ws()
|
self.skip_ws()
|
||||||
self.skip_string('()')
|
self.skip_string('()')
|
||||||
|
self.assert_end()
|
||||||
return res2, False
|
return res2, False
|
||||||
except DefinitionError as e2:
|
except DefinitionError as e2:
|
||||||
errs = []
|
errs = []
|
||||||
@ -7145,7 +7147,6 @@ class CPPDomain(Domain):
|
|||||||
parser = DefinitionParser(target, warner, env.config)
|
parser = DefinitionParser(target, warner, env.config)
|
||||||
try:
|
try:
|
||||||
ast, isShorthand = parser.parse_xref_object()
|
ast, isShorthand = parser.parse_xref_object()
|
||||||
parser.assert_end()
|
|
||||||
except DefinitionError as e:
|
except DefinitionError as e:
|
||||||
def findWarning(e): # as arg to stop flake8 from complaining
|
def findWarning(e): # as arg to stop flake8 from complaining
|
||||||
if typ != 'any' and typ != 'func':
|
if typ != 'any' and typ != 'func':
|
||||||
@ -7154,7 +7155,6 @@ class CPPDomain(Domain):
|
|||||||
parser2 = DefinitionParser(target[:-2], warner, env.config)
|
parser2 = DefinitionParser(target[:-2], warner, env.config)
|
||||||
try:
|
try:
|
||||||
parser2.parse_xref_object()
|
parser2.parse_xref_object()
|
||||||
parser2.assert_end()
|
|
||||||
except DefinitionError as e2:
|
except DefinitionError as e2:
|
||||||
return target[:-2], e2
|
return target[:-2], e2
|
||||||
# strange, that we don't get the error now, use the original
|
# strange, that we don't get the error now, use the original
|
||||||
|
@ -755,6 +755,20 @@ def test_attributes():
|
|||||||
check('member', 'int *[[attr]] *i', {1: 'i__iPP', 2: '1i'})
|
check('member', 'int *[[attr]] *i', {1: 'i__iPP', 2: '1i'})
|
||||||
|
|
||||||
|
|
||||||
|
def test_xref_parsing():
|
||||||
|
def check(target):
|
||||||
|
class Config:
|
||||||
|
cpp_id_attributes = ["id_attr"]
|
||||||
|
cpp_paren_attributes = ["paren_attr"]
|
||||||
|
parser = DefinitionParser(target, None, Config())
|
||||||
|
ast, isShorthand = parser.parse_xref_object()
|
||||||
|
parser.assert_end()
|
||||||
|
check('f')
|
||||||
|
check('f()')
|
||||||
|
check('void f()')
|
||||||
|
check('T f()')
|
||||||
|
|
||||||
|
|
||||||
# def test_print():
|
# def test_print():
|
||||||
# # used for getting all the ids out for checking
|
# # used for getting all the ids out for checking
|
||||||
# for a in ids:
|
# for a in ids:
|
||||||
|
Loading…
Reference in New Issue
Block a user