diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-09-05 21:26:28 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-28 12:50:39 +0200 |
commit | 5c22a5eccee5a9abb47412537b5ac783353196d6 (patch) | |
tree | 1f2140af6e783bae319ead70c9315563d3fc595a | |
parent | ead793c527e22d181b92bbbec8332d3090a51870 (diff) | |
download | qttools-5c22a5eccee5a9abb47412537b5ac783353196d6.tar.gz |
update size calculations for assignment statements
this was forgotten when the value lists were extended by a size hint.
Change-Id: I6f9b55ed671224a9b8735c8d937f94aac4a73a42
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
(cherry picked from qtcreator/f24c9865306624c2fc150d4bd262a5c4d5a3689a)
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r-- | src/linguist/shared/proitems.h | 1 | ||||
-rw-r--r-- | src/linguist/shared/qmakeparser.cpp | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/linguist/shared/proitems.h b/src/linguist/shared/proitems.h index 71db00486..734355474 100644 --- a/src/linguist/shared/proitems.h +++ b/src/linguist/shared/proitems.h @@ -275,6 +275,7 @@ enum ProToken { TokRemove, // variable -= TokReplace, // variable ~= // previous literal/expansion is a variable manipulation + // - lower bound for expected output length (1) // - value expression + TokValueTerminator TokValueTerminator, // assignment value terminator TokLiteral, // literal string (fully dequoted) diff --git a/src/linguist/shared/qmakeparser.cpp b/src/linguist/shared/qmakeparser.cpp index 93c7a54ab..d4e9e575d 100644 --- a/src/linguist/shared/qmakeparser.cpp +++ b/src/linguist/shared/qmakeparser.cpp @@ -298,12 +298,12 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra // Worst-case size calculations: // - line marker adds 1 (2-nl) to 1st token of each line // - empty assignment "A=":2 => - // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + - // TokValueTerminator(1) == 7 (8) + // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + 0(1) + + // TokValueTerminator(1) == 8 (9) // - non-empty assignment "A=B C":5 => - // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + + // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + 2(1) + // TokLiteral(1) + len(1) + "B"(1) + - // TokLiteral(1) + len(1) + "C"(1) + TokValueTerminator(1) == 13 (14) + // TokLiteral(1) + len(1) + "C"(1) + TokValueTerminator(1) == 14 (15) // - variable expansion: "$$f":3 => // TokVariable(1) + hash(2) + len(1) + "f"(1) = 5 // - function expansion: "$$f()":5 => |