mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-02 20:30:30 -06:00
C++ domain: Add support for semicolon in declarations
This commit is contained in:
1 parent
d68aa335c4
commit
50ae1b04e8
2 files changed
+31
-9
No files matched your search
@@ -33,10 +33,8 @@ def parse(name, string):
|
||||
return ast
|
||||
|
||||
|
||||
def check(name, input, idDict, output=None):
|
||||
def _check(name, input, idDict, output):
|
||||
# first a simple check of the AST
|
||||
if output is None:
|
||||
output = input
|
||||
ast = parse(name, input)
|
||||
res = str(ast)
|
||||
if res != output:
|
||||
@@ -83,6 +81,15 @@ def check(name, input, idDict, output=None):
|
||||
raise DefinitionError("")
|
||||
|
||||
|
||||
def check(name, input, idDict, output=None):
|
||||
if output is None:
|
||||
output = input
|
||||
# First, check without semicolon
|
||||
_check(name, input, idDict, output)
|
||||
# Second, check with semicolon
|
||||
_check(name, input + ';', idDict, output + ';')
|
||||
|
||||
|
||||
def test_fundamental_types():
|
||||
# see https://en.cppreference.com/w/cpp/language/types
|
||||
for t, id_v2 in cppDomain._id_fundamental_v2.items():
|
||||
|
||||
Reference in new issue
Block a user