Commit 6a0a13f6 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen Committed by Oswald Buddenhagen
Browse files

remove the entirely insane whitespace compression



it was merely an artifact of using QString::simplified() on the
unparsed (!) project code. there is no reason why anyone should actually
rely on it, so just remove it.

Change-Id: If9b957c4b1263f3990a2331f8851bb1c06154ea8
Reviewed-by: default avatarQt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from qtbase/c3c4f1eb5301a4fda17a9a48012df45f9a0ee7a3)
parent b154c325
...@@ -334,9 +334,8 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra ...@@ -334,9 +334,8 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra
int argc = 0; int argc = 0;
int wordCount = 0; // Number of words in currently accumulated expression int wordCount = 0; // Number of words in currently accumulated expression
int lastIndent = 0; // Previous line's indentation, to detect accidental continuation abuse int lastIndent = 0; // Previous line's indentation, to detect accidental continuation abuse
bool putSpace = false; // Only ever true inside quoted string
bool lineMarked = true; // For in-expression markers bool lineMarked = true; // For in-expression markers
ushort needSep = TokNewStr; // Complementary to putSpace: separator outside quotes ushort needSep = TokNewStr; // Met unquoted whitespace
ushort quote = 0; ushort quote = 0;
ushort term = 0; ushort term = 0;
...@@ -488,10 +487,6 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra ...@@ -488,10 +487,6 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra
if (c == '$') { if (c == '$') {
if (*cur == '$') { // may be EOF, EOL, WS, '#' or '\\' if past end if (*cur == '$') { // may be EOF, EOL, WS, '#' or '\\' if past end
cur++; cur++;
if (putSpace) {
putSpace = false;
*ptr++ = ' ';
}
FLUSH_LITERAL(); FLUSH_LITERAL();
if (!lineMarked) { if (!lineMarked) {
lineMarked = true; lineMarked = true;
...@@ -613,13 +608,6 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra ...@@ -613,13 +608,6 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra
} else if (quote) { } else if (quote) {
if (c == quote) { if (c == quote) {
quote = 0; quote = 0;
if (putSpace) {
putSpace = false;
*ptr++ = ' ';
}
goto nextChr;
} else if ((c == ' ' || c == '\t') && context != CtxPureValue) {
putSpace = true;
goto nextChr; goto nextChr;
} else if (c == '!' && ptr == xprPtr && context == CtxTest) { } else if (c == '!' && ptr == xprPtr && context == CtxTest) {
m_invert ^= true; m_invert ^= true;
...@@ -787,10 +775,6 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra ...@@ -787,10 +775,6 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra
languageWarning(fL1S("Possible accidental line continuation")); languageWarning(fL1S("Possible accidental line continuation"));
} }
} }
if (putSpace) {
putSpace = false;
*ptr++ = ' ';
}
*ptr++ = c; *ptr++ = c;
nextChr: nextChr:
if (cur == end) if (cur == end)
...@@ -801,7 +785,7 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra ...@@ -801,7 +785,7 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra
lineEnd: lineEnd:
if (lineCont) { if (lineCont) {
if (quote) { if (quote) {
putSpace = true; *ptr++ = ' ';
} else { } else {
FLUSH_LITERAL(); FLUSH_LITERAL();
needSep = TokNewStr; needSep = TokNewStr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment