diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2017-03-08 13:14:59 +0100 |
---|---|---|
committer | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2017-03-08 12:34:12 +0000 |
commit | 11d60dcad62b53d20f12c6f548eea3df412a43cc (patch) | |
tree | 442d260482f666f409aeb3598b30ba3e5306852a /src/tools/moc/preprocessor.cpp | |
parent | b53d7664c90b0deb2c35f586eb8c6d168f58752f (diff) |
moc: Fix parsing of digit separator
[ChangeLog][moc] Fixed parsing errors in presence of
C++14 digit separators.
Task-number: QTBUG-59351
Change-Id: Iea38ea7388853d84b819c2beb78a59371f57bf7d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/tools/moc/preprocessor.cpp')
-rw-r--r-- | src/tools/moc/preprocessor.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index f5639ffe31..32c94639ab 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -236,7 +236,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso data -= 2; break; case DIGIT: - while (is_digit_char(*data)) + while (is_digit_char(*data) || *data == '\'') ++data; if (!*data || *data != '.') { token = INTEGER_LITERAL; @@ -244,7 +244,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso (*data == 'x' || *data == 'X') && *lexem == '0') { ++data; - while (is_hex_char(*data)) + while (is_hex_char(*data) || *data == '\'') ++data; } break; @@ -253,13 +253,13 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso ++data; Q_FALLTHROUGH(); case FLOATING_LITERAL: - while (is_digit_char(*data)) + while (is_digit_char(*data) || *data == '\'') ++data; if (*data == '+' || *data == '-') ++data; if (*data == 'e' || *data == 'E') { ++data; - while (is_digit_char(*data)) + while (is_digit_char(*data) || *data == '\'') ++data; } if (*data == 'f' || *data == 'F' @@ -413,7 +413,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso token = PP_CHARACTER_LITERAL; break; case PP_DIGIT: - while (is_digit_char(*data)) + while (is_digit_char(*data) || *data == '\'') ++data; if (!*data || *data != '.') { token = PP_INTEGER_LITERAL; @@ -421,7 +421,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso (*data == 'x' || *data == 'X') && *lexem == '0') { ++data; - while (is_hex_char(*data)) + while (is_hex_char(*data) || *data == '\'') ++data; } break; @@ -430,13 +430,13 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso ++data; Q_FALLTHROUGH(); case PP_FLOATING_LITERAL: - while (is_digit_char(*data)) + while (is_digit_char(*data) || *data == '\'') ++data; if (*data == '+' || *data == '-') ++data; if (*data == 'e' || *data == 'E') { ++data; - while (is_digit_char(*data)) + while (is_digit_char(*data) || *data == '\'') ++data; } if (*data == 'f' || *data == 'F' |