forked from qt-creator/qt-creator
[C++] Rewrite of the preprocessor.
This rewrite fixes a couple of issues with the pre-processor. It now supports: - macros in macro bodies - stringification of parameters [cpp.stringize] - the concatenation operator [cpp.concat] - #include MACRO_HERE - defined() inside macro bodies used in pp-conditions. Change-Id: Ifdb78041fb6afadf44f939a4bd66ce2832b8601f Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -92,19 +92,11 @@ QString Macro::decoratedName() const
|
||||
QString Macro::toString() const
|
||||
{
|
||||
QString text = decoratedName();
|
||||
text.append(QString::fromUtf8(_definition.constData(), _definition.size()));
|
||||
text.append(QString::fromUtf8(_definitionText.constData(), _definitionText.size()));
|
||||
return text;
|
||||
}
|
||||
|
||||
QString Macro::toStringWithLineBreaks() const
|
||||
{
|
||||
if (_lineBreaks.isEmpty())
|
||||
return toString();
|
||||
|
||||
QString text = decoratedName();
|
||||
QString definitionWithBreaks = QString::fromUtf8(_definition.constData(), _definition.size());
|
||||
foreach (unsigned pos, _lineBreaks)
|
||||
definitionWithBreaks[pos] = '\n';
|
||||
text.append(definitionWithBreaks);
|
||||
return text;
|
||||
return toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user