diff options
author | Jakob Lykke Andersen <jakobandersen@users.noreply.github.com> | 2019-04-14 13:41:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-14 13:41:56 +0200 |
commit | b6a24df5f56e95f56e40e80beea96e78d89397a8 (patch) | |
tree | 59449c596f0bc64565d583c36afeda6c7615a2f8 | |
parent | a46d4c9bca0170da8119df6f69162eccfcf2c918 (diff) | |
parent | 396228953f90b8db1cb9121dcc882815c26cd69b (diff) | |
download | sphinx-git-b6a24df5f56e95f56e40e80beea96e78d89397a8.tar.gz |
Merge pull request #6298 from jakobandersen/cpp_hex_lit
C++, allow 8 and 9 in hexadecimal integer literals.
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | sphinx/domains/cpp.py | 2 | ||||
-rw-r--r-- | tests/test_domain_cpp.py | 2 |
3 files changed, 4 insertions, 2 deletions
@@ -16,6 +16,8 @@ Features added Bugs fixed ---------- +* #6286: C++, allow 8 and 9 in hexadecimal integer literals. + Testing -------- diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 03e91bcee..dcc798190 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -292,7 +292,7 @@ logger = logging.getLogger(__name__) _integer_literal_re = re.compile(r'[1-9][0-9]*') _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]*') +_hex_literal_re = re.compile(r'0[xX][0-9a-fA-F][0-9a-fA-F]*') _binary_literal_re = re.compile(r'0[bB][01][01]*') _integer_suffix_re = re.compile(r'') _float_literal_re = re.compile(r'''(?x) diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py index d6470dc7c..c81d66b17 100644 --- a/tests/test_domain_cpp.py +++ b/tests/test_domain_cpp.py @@ -114,7 +114,7 @@ def test_expressions(): exprCheck('nullptr', 'LDnE') exprCheck('true', 'L1E') exprCheck('false', 'L0E') - ints = ['5', '0', '075', '0xF', '0XF', '0b1', '0B1'] + ints = ['5', '0', '075', '0x0123456789ABCDEF', '0XF', '0b1', '0B1'] unsignedSuffix = ['', 'u', 'U'] longSuffix = ['', 'l', 'L', 'll', 'LL'] for i in ints: |