| 31 | } |
| 32 | |
| 33 | static QString parameterListString(const MacroDefinition& macro) |
| 34 | { |
| 35 | // A function-like macro can have 0 parameters, e.g. `#define m() 1`. |
| 36 | // Check isFunctionLike() rather than parametersSize() here in order to display "()" in this case. |
| 37 | if (!macro.isFunctionLike()) { |
| 38 | Q_ASSERT(macro.parametersSize() == 0); |
| 39 | return QString(); |
| 40 | } |
| 41 | |
| 42 | QStringList parameterList; |
| 43 | parameterList.reserve(macro.parametersSize()); |
| 44 | FOREACH_FUNCTION (const auto& parameter, macro.parameters) { |
| 45 | parameterList << parameter.str(); |
| 46 | } |
| 47 | |
| 48 | return QLatin1Char('(') + parameterList.join(QLatin1String(", ")) + QLatin1Char(')'); |
| 49 | } |
| 50 | |
| 51 | QString MacroNavigationContext::html(bool shorten) |
| 52 | { |
no test coverage detected