visitor.setCumulative(true);
visitor.setOutputDir(option->shadowedPath(proFile));
ProFile *pro;
- if (!(pro = parser->parsedProFile(proFile))) {
+ if (!(pro = parser->parsedProFile(proFile, topLevel ? QMakeParser::ParseReportMissing
+ : QMakeParser::ParseDefault))) {
if (topLevel)
*fail = true;
continue;
locker.unlock();
#endif
pro = new ProFile(fileName);
- if (!read(pro)) {
+ if (!read(pro, flags)) {
delete pro;
pro = 0;
} else {
}
} else {
pro = new ProFile(fileName);
- if (!read(pro)) {
+ if (!read(pro, flags)) {
delete pro;
pro = 0;
}
m_cache->discardFile(fileName);
}
-bool QMakeParser::read(ProFile *pro)
+bool QMakeParser::read(ProFile *pro, ParseFlags flags)
{
QFile file(pro->fileName());
if (!file.open(QIODevice::ReadOnly)) {
- if (m_handler && IoUtils::exists(pro->fileName()))
+ if (m_handler && ((flags && ParseReportMissing) || IoUtils::exists(pro->fileName())))
m_handler->message(QMakeParserHandler::ParserIoError,
fL1S("Cannot read %1: %2").arg(pro->fileName(), file.errorString()));
return false;
enum ParseFlag {
ParseDefault = 0,
- ParseUseCache = 1
+ ParseUseCache = 1,
+ ParseReportMissing = 2
};
Q_DECLARE_FLAGS(ParseFlags, ParseFlag)
ushort terminator; // '}' if replace function call is braced, ':' if test function
};
- bool read(ProFile *pro);
+ bool read(ProFile *pro, ParseFlags flags);
bool read(ProFile *pro, const QString &content, int line, SubGrammar grammar);
ALWAYS_INLINE void putTok(ushort *&tokPtr, ushort tok);