void (PyCallExpression expression, PyElementGenerator elementGenerator) { PyExpression[] argumentList = expression.getArguments(); StringBuilder stringBuilder = new StringBuilder(); int size = argumentList.length; for (int i = 0; i != size; ++i) { PyExpression argument = argumentList[i]; if (argument instanceof PyKeywordArgument) { stringBuilder.append("'"); stringBuilder.append(((PyKeywordArgument)argument).getKeyword()); stringBuilder.append("' : "); stringBuilder.append(((PyKeywordArgument)argument).getValueExpression().getText()); if (i != size-1) stringBuilder.append(","); } } PyDictLiteralExpression dict = (PyDictLiteralExpression)elementGenerator.createFromText(LanguageLevel.forElement(expression), PyExpressionStatement.class, "{" + stringBuilder + "}").getExpression(); expression.replace(dict); }