Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
72d965e2
Commit
72d965e2
authored
Dec 16, 2008
by
Oswald Buddenhagen
Browse files
Fixes: processing of else branches
parent
2274ceb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
shared/proparser/profileevaluator.cpp
View file @
72d965e2
...
...
@@ -530,11 +530,15 @@ bool ProFileEvaluator::Private::visitBeginProBlock(ProBlock *block)
if
(
!
m_skipLevel
)
{
m_prevCondition
=
m_condition
;
m_condition
=
ConditionFalse
;
}
else
{
Q_ASSERT
(
m_condition
!=
ConditionTrue
);
}
}
else
if
(
block
->
blockKind
()
&
ProBlock
::
ScopeContentsKind
)
{
m_updateCondition
=
false
;
if
(
m_condition
!=
ConditionTrue
)
++
m_skipLevel
;
else
Q_ASSERT
(
!
m_skipLevel
);
}
return
true
;
}
...
...
@@ -542,8 +546,14 @@ bool ProFileEvaluator::Private::visitBeginProBlock(ProBlock *block)
bool
ProFileEvaluator
::
Private
::
visitEndProBlock
(
ProBlock
*
block
)
{
if
(
block
->
blockKind
()
&
ProBlock
::
ScopeContentsKind
)
{
if
(
m_skipLevel
)
if
(
m_skipLevel
)
{
Q_ASSERT
(
m_condition
!=
ConditionTrue
);
--
m_skipLevel
;
}
else
{
// Conditionals contained inside this block may have changed the state.
// So we reset it here to make an else following us do the right thing.
m_condition
=
ConditionTrue
;
}
}
return
true
;
}
...
...
@@ -572,8 +582,12 @@ bool ProFileEvaluator::Private::visitProCondition(ProCondition *cond)
{
if
(
!
m_skipLevel
)
{
if
(
cond
->
text
().
toLower
()
==
QLatin1String
(
"else"
))
{
// The state ConditionElse makes sure that subsequential elses are ignored.
// That's braindead, but qmake is like that.
if
(
m_prevCondition
==
ConditionTrue
)
m_condition
=
ConditionElse
;
else
if
(
m_prevCondition
==
ConditionFalse
)
m_condition
=
ConditionTrue
;
}
else
if
(
m_condition
==
ConditionFalse
)
{
if
(
isActiveConfig
(
cond
->
text
(),
true
)
^
m_invertNext
)
m_condition
=
ConditionTrue
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment