forked from qt-creator/qt-creator
CPlusPlus: Make (sub-)languague selection more generic
Change-Id: I4e2df6992b446adec662ab07671acd41715e41fd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
@@ -45,16 +45,19 @@ class tst_AST: public QObject
|
||||
Control control;
|
||||
|
||||
public:
|
||||
|
||||
TranslationUnit *parse(const QByteArray &source,
|
||||
TranslationUnit::ParseMode mode,
|
||||
bool blockErrors = false,
|
||||
bool qtMocRun = false)
|
||||
{
|
||||
const StringLiteral *fileId = control.stringLiteral("<stdin>");
|
||||
LanguageFeatures features;
|
||||
features.objCEnabled = true;
|
||||
features.qtEnabled = qtMocRun;
|
||||
features.qtKeywordsEnabled = qtMocRun;
|
||||
features.qtMocRunEnabled = qtMocRun;
|
||||
TranslationUnit *unit = new TranslationUnit(&control, fileId);
|
||||
unit->setObjCEnabled(true);
|
||||
unit->setQtMocRunEnabled(qtMocRun);
|
||||
unit->setLanguageFeatures(features);
|
||||
unit->setSource(source.constData(), source.length());
|
||||
unit->blockErrors(blockErrors);
|
||||
unit->parse(mode);
|
||||
|
||||
Reference in New Issue
Block a user