Commit 8a1e9e73 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

always flush scopes on closing brace



without that, both the lines
  cond1 { cond2: VAR = val }
and
  cond1 { cond2: else: cond3 }
would yield two bogus errors: first an excess brace, and then a missing
one.

Change-Id: I8609106c1ad387577deec2077e2ce13507ac4d3f
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
(cherry picked from qtbase/962c7ab6f8705a8fb7b60c3544d4189503c1ec17)
parent 76469295
...@@ -721,8 +721,9 @@ void QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra ...@@ -721,8 +721,9 @@ void QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra
} else if (c == '}') { } else if (c == '}') {
FLUSH_LHS_LITERAL(); FLUSH_LHS_LITERAL();
finalizeCond(tokPtr, buf, ptr, wordCount); finalizeCond(tokPtr, buf, ptr, wordCount);
flushScopes(tokPtr); m_state = StNew; // De-facto newline
closeScope: closeScope:
flushScopes(tokPtr);
if (!m_blockstack.top().braceLevel) { if (!m_blockstack.top().braceLevel) {
parseError(fL1S("Excess closing brace.")); parseError(fL1S("Excess closing brace."));
} else if (!--m_blockstack.top().braceLevel } else if (!--m_blockstack.top().braceLevel
......
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