Skip to content
GitLab
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
8b9f29f9
Commit
8b9f29f9
authored
Oct 02, 2009
by
Oswald Buddenhagen
Browse files
implement eval()
parent
1de6a6e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/shared/proparser/profileevaluator.cpp
View file @
8b9f29f9
...
...
@@ -139,8 +139,8 @@ public:
/////////////// Reading pro file
bool
read
(
ProFile
*
pro
);
bool
read
(
Pro
File
*
pro
,
const
QString
&
content
);
bool
read
(
Pro
File
*
pro
,
QTextStream
*
ts
);
bool
read
(
Pro
Block
*
pro
,
const
QString
&
content
);
bool
read
(
Pro
Block
*
pro
,
QTextStream
*
ts
);
ProBlock
*
currentBlock
();
void
updateItem
(
ushort
*
ptr
);
...
...
@@ -288,22 +288,23 @@ bool ProFileEvaluator::Private::read(ProFile *pro)
}
QTextStream
ts
(
&
file
);
m_lineNo
=
1
;
return
read
(
pro
,
&
ts
);
}
bool
ProFileEvaluator
::
Private
::
read
(
Pro
File
*
pro
,
const
QString
&
content
)
bool
ProFileEvaluator
::
Private
::
read
(
Pro
Block
*
pro
,
const
QString
&
content
)
{
QString
str
(
content
);
QTextStream
ts
(
&
str
,
QIODevice
::
ReadOnly
|
QIODevice
::
Text
);
m_lineNo
=
1
;
return
read
(
pro
,
&
ts
);
}
bool
ProFileEvaluator
::
Private
::
read
(
Pro
File
*
pro
,
QTextStream
*
ts
)
bool
ProFileEvaluator
::
Private
::
read
(
Pro
Block
*
pro
,
QTextStream
*
ts
)
{
// Parser state
m_block
=
0
;
m_commentItem
=
0
;
m_lineNo
=
1
;
m_blockstack
.
clear
();
m_blockstack
.
push
(
pro
);
...
...
@@ -2253,8 +2254,17 @@ ProItem::ProItemReturn ProFileEvaluator::Private::evaluateConditionalFunction(
return
ProItem
::
ReturnFalse
;
#if 0
case T_REQUIRES:
case T_EVAL:
#endif
case
T_EVAL
:
{
ProBlock
*
pro
=
new
ProBlock
(
0
);
if
(
!
read
(
pro
,
args
.
join
(
QLatin1String
(
" "
))))
{
delete
pro
;
return
ProItem
::
ReturnFalse
;
}
bool
ret
=
pro
->
Accept
(
this
);
pro
->
deref
();
return
returnBool
(
ret
);
}
case
T_FOR
:
{
if
(
m_cumulative
)
// This is a no-win situation, so just pretend it's no loop
return
ProItem
::
ReturnTrue
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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