mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-02 20:30:30 -06:00
C and C++ domains, change to new logging
Also add get_source_info() to SphinxDirective and SphinxRole
This commit is contained in:
1 parent
cb0f33eb8f
commit
02c4a0d02f
7 files changed
+120
-126
No files matched your search
+2
-17
@@ -28,7 +28,7 @@ from sphinx.util import docutils
|
||||
|
||||
|
||||
def parse(name, string):
|
||||
parser = DefinitionParser(string, None)
|
||||
parser = DefinitionParser(string, location=None, emitWarnings=True)
|
||||
parser.allowFallbackExpressionParsing = False
|
||||
ast = parser.parse_declaration(name, name)
|
||||
parser.assert_end()
|
||||
@@ -87,7 +87,7 @@ def check(name, input, idDict, output=None):
|
||||
|
||||
def test_expressions():
|
||||
def exprCheck(expr, output=None):
|
||||
parser = DefinitionParser(expr, None)
|
||||
parser = DefinitionParser(expr, location=None, emitWarnings=True)
|
||||
parser.allowFallbackExpressionParsing = False
|
||||
ast = parser.parse_expression()
|
||||
parser.assert_end()
|
||||
@@ -439,21 +439,6 @@ def test_attributes():
|
||||
check('member', 'int *[[attr]] *i', {1: 'i__iPP', 2: '1i'})
|
||||
|
||||
|
||||
def test_xref_parsing():
|
||||
return # TODO
|
||||
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():
|
||||
# # used for getting all the ids out for checking
|
||||
# for a in ids:
|
||||
|
||||
Reference in new issue
Block a user