Refactored to use creation of expression by pattern instead of plain text

This commit is contained in:
Valentin Kipyatkov
2015-10-20 18:50:54 +03:00
parent 311bd5f25d
commit 7c8967ea4e
7 changed files with 38 additions and 44 deletions
@@ -272,6 +272,16 @@ public class BuilderByPattern<TElement> {
return this
}
public fun appendExpressions(expressions: Iterable<KtExpression?>, separator: String = ","): BuilderByPattern<TElement> {
for ((index, expression) in expressions.withIndex()) {
if (index > 0) {
appendFixedText(separator)
}
appendExpression(expression)
}
return this
}
public fun appendTypeReference(typeRef: KtTypeReference?): BuilderByPattern<TElement> {
if (typeRef != null) {
patternBuilder.append("$" + arguments.size())