mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
C, C++, parse <width> <complex/imaginary>
This commit is contained in:
parent
a4371ea94c
commit
4b62b6cb82
@ -106,6 +106,7 @@ _simple_type_sepcifiers_re = re.compile(r"""(?x)
|
||||
# Floating-point
|
||||
# --------------
|
||||
|(float|double|long\s+double)(\s+(_Complex|complex|_Imaginary|imaginary))?
|
||||
|(_Complex|complex|_Imaginary|imaginary)\s+(float|double|long\s+double)
|
||||
|_Decimal(32|64|128)
|
||||
# extensions
|
||||
|__float80|_Float64x|__float128|_Float128|__ibm128
|
||||
|
@ -349,6 +349,7 @@ _simple_type_sepcifiers_re = re.compile(r"""(?x)
|
||||
# Floating-point
|
||||
# --------------
|
||||
|(float|double|long\s+double)(\s+(_Complex|_Imaginary))?
|
||||
|(_Complex|_Imaginary)\s+(float|double|long\s+double)
|
||||
# extensions
|
||||
|__float80|_Float64x|__float128|_Float128
|
||||
# Integer types that could be prefixes of the previous ones
|
||||
@ -482,16 +483,14 @@ _id_fundamental_v2 = {
|
||||
'float': 'f',
|
||||
'double': 'd',
|
||||
'long double': 'e',
|
||||
'__float80': 'e',
|
||||
'_Float64x': 'e',
|
||||
'__float128': 'g',
|
||||
'_Float128': 'g',
|
||||
'float _Complex': 'Cf',
|
||||
'double _Complex': 'Cd',
|
||||
'long double _Complex': 'Ce',
|
||||
'float _Imaginary': 'f',
|
||||
'double _Imaginary': 'd',
|
||||
'long double _Imaginary': 'e',
|
||||
'__float80': 'e', '_Float64x': 'e',
|
||||
'__float128': 'g', '_Float128': 'g',
|
||||
'float _Complex': 'Cf', '_Complex float': 'Cf',
|
||||
'double _Complex': 'Cd', '_Complex double': 'Cd',
|
||||
'long double _Complex': 'Ce', '_Complex long double': 'Ce',
|
||||
'float _Imaginary': 'f', '_Imaginary float': 'f',
|
||||
'double _Imaginary': 'd', '_Imaginary double': 'd',
|
||||
'long double _Imaginary': 'e', '_Imaginary long double': 'e',
|
||||
'auto': 'Da',
|
||||
'decltype(auto)': 'Dc',
|
||||
'std::nullptr_t': 'Dn'
|
||||
|
@ -306,7 +306,8 @@ def test_domain_c_ast_fundamental_types():
|
||||
for f in ('float', 'double', 'long double'):
|
||||
yield f
|
||||
yield from (f + " _Complex", f + " complex")
|
||||
yield from (f + " _Imaginary", f + " imaginary")
|
||||
yield from ("_Complex " + f, "complex " + f)
|
||||
yield from ("_Imaginary " + f, "imaginary " + f)
|
||||
# extensions
|
||||
# https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html#Floating-Types
|
||||
yield from ('__float80', '_Float64x',
|
||||
|
Loading…
Reference in New Issue
Block a user