diff options
Diffstat (limited to 'sphinx/domains/cpp.py')
-rw-r--r-- | sphinx/domains/cpp.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 40dfd5df9..380a9e98a 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -293,7 +293,18 @@ _octal_literal_re = re.compile(r'0[0-7]*') _hex_literal_re = re.compile(r'0[xX][0-7a-fA-F][0-7a-fA-F]*') _binary_literal_re = re.compile(r'0[bB][01][01]*') _integer_suffix_re = re.compile(r'') -_float_literal_re = re.compile(r'[+-]?[0-9]*\.[0-9]+') +_float_literal_re = re.compile(r'''(?x) + [+-]?( + # decimal + ([0-9]+[eE][+-]?[0-9]+) + | ([0-9]*\.[0-9]+([eE][+-]?[0-9]+)?) + | ([0-9]+\.([eE][+-]?[0-9]+)?) + # hex + | (0[xX][0-9a-fA-F]+[pP][+-]?[0-9a-fA-F]+) + | (0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+([pP][+-]?[0-9a-fA-F]+)?) + | (0[xX][0-9a-fA-F]+\.([pP][+-]?[0-9a-fA-F]+)?) + ) +''') _char_literal_re = re.compile(r'''(?x) ((?:u8)|u|U|L)? '( |