summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/tokenizer.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2012-10-10 15:15:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-13 05:51:19 +0200
commit8473b6d05c50046b41f553fbfc1f6d2236d3607f (patch)
tree4119a8eedf2c387d9b5ed295f5dc1a48ca97e5a9 /src/tools/qdoc/tokenizer.cpp
parent264eeb68b2183b2808d255fc37206d3cac7dc91c (diff)
qdoc: Allow empty character literal ''
qdoc's tokenizer was reporting an error for the empty character literal ''. Now it allows it. Apparently it makes sense in .js files. Task number: QTBUG-25775 Change-Id: If407427fad9b65a035c2c4785d53c9e3d5202e62 Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/tokenizer.cpp')
-rw-r--r--src/tools/qdoc/tokenizer.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tools/qdoc/tokenizer.cpp b/src/tools/qdoc/tokenizer.cpp
index 69f2dafc39..29ce322cc9 100644
--- a/src/tools/qdoc/tokenizer.cpp
+++ b/src/tools/qdoc/tokenizer.cpp
@@ -244,6 +244,13 @@ int Tokenizer::getToken()
}
case '\'':
yyCh = getChar();
+ /*
+ Allow empty character literal. QTBUG-25775
+ */
+ if (yyCh == '\'') {
+ yyCh = getChar();
+ break;
+ }
if (yyCh == '\\')
yyCh = getChar();
do {
@@ -251,8 +258,7 @@ int Tokenizer::getToken()
} while (yyCh != EOF && yyCh != '\'');
if (yyCh == EOF) {
- yyTokLoc.warning(tr("Unterminated C++ character"
- " literal"));
+ yyTokLoc.warning(tr("Unterminated C++ character literal"));
}
else {
yyCh = getChar();