diff options
author | Topi Reinio <topi.reinio@qt.io> | 2023-03-16 19:42:17 +0000 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2023-03-17 09:57:16 +0000 |
commit | f47a4b17f778e790f9713c9e34ff5919861f49d5 (patch) | |
tree | ba3718337e195db05c9a427f61636376498401fc /src/qdoc/cppcodemarker.cpp | |
parent | daed3ea8a4e0b454d3f7541ba2f2c306fe220ddb (diff) | |
download | qttools-f47a4b17f778e790f9713c9e34ff5919861f49d5.tar.gz |
qdoc: C++ marker: Allow single quote as a separator in integer literals
Since C++14, single quotes can appear in integer literals as separators
to improve readability.
When quoting a file that contains such a literal, QDoc interpreted the
single quote as a delimiter for a char, and kept reading ahead for the
closing quote. This interfered with correct marking up of C++ code and
ultimately caused a warning:
(qdoc) warning: Something is wrong with qdoc's handling of marked code
as the plain code and marked-up code end up having different number of
lines.
Pick-to: 6.5
Fixes: QTBUG-111973
Change-Id: Icd2d95973f9cee72eb1c9e3f2d79df0af643dbaa
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/cppcodemarker.cpp')
-rw-r--r-- | src/qdoc/cppcodemarker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp index 7d4e8c4ed..32b14d24b 100644 --- a/src/qdoc/cppcodemarker.cpp +++ b/src/qdoc/cppcodemarker.cpp @@ -430,7 +430,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, const Node * /* relative */, do { finish = i; readChar(); - } while (!atEOF && (ch.isLetterOrNumber() || ch == '.')); + } while (!atEOF && (ch.isLetterOrNumber() || ch == '.' || ch == '\'')); tag = QStringLiteral("number"); } else { switch (ch.unicode()) { |