forked from qt-creator/qt-creator
add $$enumerate_vars() function
follow suit with qmake ... Change-Id: I28649e443e91c061e1452674dfc2a101b097da7f Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
@@ -76,7 +76,7 @@ enum ExpandFunc {
|
|||||||
E_SPRINTF, E_FORMAT_NUMBER, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION,
|
E_SPRINTF, E_FORMAT_NUMBER, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION,
|
||||||
E_FIND, E_SYSTEM, E_UNIQUE, E_REVERSE, E_QUOTE, E_ESCAPE_EXPAND,
|
E_FIND, E_SYSTEM, E_UNIQUE, E_REVERSE, E_QUOTE, E_ESCAPE_EXPAND,
|
||||||
E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_VAL_ESCAPE,
|
E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_VAL_ESCAPE,
|
||||||
E_REPLACE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS
|
E_REPLACE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS, E_ENUMERATE_VARS
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TestFunc {
|
enum TestFunc {
|
||||||
@@ -121,7 +121,8 @@ void QMakeEvaluator::initFunctionStatics()
|
|||||||
{ "prompt", E_PROMPT },
|
{ "prompt", E_PROMPT },
|
||||||
{ "replace", E_REPLACE },
|
{ "replace", E_REPLACE },
|
||||||
{ "sort_depends", E_SORT_DEPENDS },
|
{ "sort_depends", E_SORT_DEPENDS },
|
||||||
{ "resolve_depends", E_RESOLVE_DEPENDS }
|
{ "resolve_depends", E_RESOLVE_DEPENDS },
|
||||||
|
{ "enumerate_vars", E_ENUMERATE_VARS },
|
||||||
};
|
};
|
||||||
for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i)
|
for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i)
|
||||||
statics.expands.insert(ProString(expandInits[i].name), expandInits[i].func);
|
statics.expands.insert(ProString(expandInits[i].name), expandInits[i].func);
|
||||||
@@ -809,6 +810,15 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case E_ENUMERATE_VARS: {
|
||||||
|
QSet<ProString> keys;
|
||||||
|
foreach (const ProValueMap &vmap, m_valuemapStack)
|
||||||
|
for (ProValueMap::ConstIterator it = vmap.constBegin(); it != vmap.constEnd(); ++it)
|
||||||
|
keys.insert(it.key());
|
||||||
|
ret.reserve(keys.size());
|
||||||
|
foreach (const ProString &key, keys)
|
||||||
|
ret << key;
|
||||||
|
break; }
|
||||||
case E_INVALID:
|
case E_INVALID:
|
||||||
evalError(fL1S("'%1' is not a recognized replace function.")
|
evalError(fL1S("'%1' is not a recognized replace function.")
|
||||||
.arg(func.toQString(m_tmp1)));
|
.arg(func.toQString(m_tmp1)));
|
||||||
|
|||||||
Reference in New Issue
Block a user