diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-06-24 17:37:21 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-06-24 19:19:21 +0200 |
commit | f5e44fb7b6d48dc954478da9a92b5ebdd5ca8d62 (patch) | |
tree | c0a1175faa41361c50922228858551d83fcc9a64 /src/shared/proparser/profileparser.cpp | |
parent | 40ef148c305bc9d777e7fb686fad2a4aad99f85a (diff) | |
download | qt-creator-f5e44fb7b6d48dc954478da9a92b5ebdd5ca8d62.tar.gz |
parse braces on the RHS of assignments
this is less insane than (and thus incompatible to) qmake, but i
postulate that nobody will complain. :)
Diffstat (limited to 'src/shared/proparser/profileparser.cpp')
-rw-r--r-- | src/shared/proparser/profileparser.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/shared/proparser/profileparser.cpp b/src/shared/proparser/profileparser.cpp index 4228ede391..ede2d6771e 100644 --- a/src/shared/proparser/profileparser.cpp +++ b/src/shared/proparser/profileparser.cpp @@ -290,7 +290,7 @@ bool ProFileParser::read(ProFile *pro, const QString &in) m_operator = NoOperator; m_markLine = m_lineNo; Context context = CtxTest; - int parens = 0; + int parens = 0; // Braces in value context int argc = 0; int litCount = 0; int expCount = 0; @@ -650,6 +650,7 @@ bool ProFileParser::read(ProFile *pro, const QString &in) FLUSH_LHS_LITERAL(false); finalizeCond(tokPtr, buf, ptr); flushScopes(tokPtr); + closeScope: if (!m_blockstack.top().braceLevel) { parseError(fL1S("Excess closing brace.")); } else if (!--m_blockstack.top().braceLevel @@ -695,6 +696,20 @@ bool ProFileParser::read(ProFile *pro, const QString &in) needSep = 0; goto nextToken; } + } else { // context == CtxValue + if (c == '{') { + ++parens; + } else if (c == '}') { + if (!parens) { + FLUSH_RHS_LITERAL(false); + tokPtr[-1] = litCount ? litCount + expCount : 0; + tokPtr = ptr; + putTok(tokPtr, TokValueTerminator); + context = CtxTest; + goto closeScope; + } + --parens; + } } if (putSpace) { putSpace = false; |