73 void endVisit(AST::CallExpression *node)
override
76 AST::ExpressionNode *base = node->base;
78 while (base && base->kind == AST::Node::Kind_FieldMemberExpression) {
79 auto memberExpr =
static_cast<AST::FieldMemberExpression *>(base);
80 name.prepend(memberExpr->name);
81 name.prepend(QLatin1Char(
'.'));
82 base = memberExpr->base;
85 if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(base)) {
86 processComments(idExpr->identifierToken.begin());
88 name = idExpr->name.toString() + name;
89 const int identLineNo = idExpr->identifierToken.startLine;
90 switch (trFunctionAliasManager.trFunctionByName(name)) {
93 if (!node->arguments) {
95 << qPrintable(QStringLiteral(
"%1() requires at least one argument.\n")
101 if (!createString(node->arguments->expression, &source))
106 if (AST::ArgumentList *commentNode = node->arguments->next) {
107 if (!createString(commentNode->expression, &comment)) {
110 if (commentNode->next)
114 if (!sourcetext.isEmpty())
115 yyMsg(identLineNo) << qPrintable(QStringLiteral(
"//% cannot be used with %1(). Ignoring\n").arg(name));
118 comment, QString(), m_fileName,
119 node->firstSourceLocation().startLine, QStringList(),
120 TranslatorMessage::Unfinished, plural);
121 msg.setExtraComment(ParserTool::transcode(extracomment.simplified()));
129 if (! (node->arguments && node->arguments->next)) {
130 yyMsg(identLineNo) << qPrintable(QStringLiteral(
"%1() requires at least two arguments.\n").arg(name));
135 if (!createString(node->arguments->expression, &context))
138 AST::ArgumentList *sourceNode = node->arguments->next;
141 if (!createString(sourceNode->expression, &source))
144 if (!sourcetext.isEmpty())
145 yyMsg(identLineNo) << qPrintable(QStringLiteral(
"//% cannot be used with %1(). Ignoring\n").arg(name));
149 if (AST::ArgumentList *commentNode = sourceNode->next) {
150 if (!createString(commentNode->expression, &comment)) {
154 if (commentNode->next)
159 comment, QString(), m_fileName,
160 node->firstSourceLocation().startLine, QStringList(),
161 TranslatorMessage::Unfinished, plural);
162 msg.setExtraComment(ParserTool::transcode(extracomment.simplified()));
170 if (!node->arguments) {
171 yyMsg(identLineNo) << qPrintable(QStringLiteral(
"%1() requires at least one argument.\n").arg(name));
176 if (!createString(node->arguments->expression, &id))
179 if (!msgid.isEmpty()) {
180 yyMsg(identLineNo) << qPrintable(QStringLiteral(
"//= cannot be used with %1(). Ignoring\n").arg(name));
184 bool plural = node->arguments->next;
187 QString(), QString(), m_fileName,
188 node->firstSourceLocation().startLine, QStringList(),
189 TranslatorMessage::Unfinished, plural);
190 msg.setExtraComment(ParserTool::transcode(extracomment.simplified()));