Temporarily replace usages of extension on iterators in compiler by _tmp() calls
This commit is contained in:
committed by
Andrey Breslav
parent
f07b7cc58d
commit
a3b45b919c
+2
-1
@@ -41,6 +41,7 @@ import com.intellij.psi.PsiTypeParameter
|
|||||||
import org.jetbrains.jet.lang.psi.JetClassOrObject
|
import org.jetbrains.jet.lang.psi.JetClassOrObject
|
||||||
import com.intellij.psi.impl.light.LightTypeParameterListBuilder
|
import com.intellij.psi.impl.light.LightTypeParameterListBuilder
|
||||||
import com.intellij.psi.search.SearchScope
|
import com.intellij.psi.search.SearchScope
|
||||||
|
import org.jetbrains.jet.utils.*
|
||||||
|
|
||||||
public class KotlinLightMethodForDeclaration(
|
public class KotlinLightMethodForDeclaration(
|
||||||
manager: PsiManager, override val delegate: PsiMethod, override val origin: JetDeclaration, containingClass: PsiClass
|
manager: PsiManager, override val delegate: PsiMethod, override val origin: JetDeclaration, containingClass: PsiClass
|
||||||
@@ -51,7 +52,7 @@ public class KotlinLightMethodForDeclaration(
|
|||||||
cacheManager.createCachedValue<PsiParameterList>({
|
cacheManager.createCachedValue<PsiParameterList>({
|
||||||
val parameterBuilder = LightParameterListBuilder(getManager(), JetLanguage.INSTANCE)
|
val parameterBuilder = LightParameterListBuilder(getManager(), JetLanguage.INSTANCE)
|
||||||
|
|
||||||
for ((index, parameter) in delegate.getParameterList().getParameters().withIndices()) {
|
for ((index, parameter) in delegate.getParameterList().getParameters().withIndices_tmp()) {
|
||||||
parameterBuilder.addParameter(KotlinLightParameter(parameter, index, this))
|
parameterBuilder.addParameter(KotlinLightParameter(parameter, index, this))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -127,7 +127,7 @@ public class LazyJavaClassMemberScope(
|
|||||||
val methods = jClass.getMethods()
|
val methods = jClass.getMethods()
|
||||||
val result = ArrayList<ValueParameterDescriptor>(methods.size())
|
val result = ArrayList<ValueParameterDescriptor>(methods.size())
|
||||||
|
|
||||||
for ((index, method) in methods.withIndices()) {
|
for ((index, method) in methods.withIndices_tmp()) {
|
||||||
assert(method.getValueParameters().isEmpty(), "Annotation method can't have parameters: " + method)
|
assert(method.getValueParameters().isEmpty(), "Annotation method can't have parameters: " + method)
|
||||||
|
|
||||||
val jReturnType = method.getReturnType() ?: throw AssertionError("Annotation method has no return type: " + method)
|
val jReturnType = method.getReturnType() ?: throw AssertionError("Annotation method has no return type: " + method)
|
||||||
|
|||||||
+2
-1
@@ -35,6 +35,7 @@ import org.jetbrains.jet.lang.resolve.java.sam.SingleAbstractMethodUtils
|
|||||||
import org.jetbrains.jet.utils.Printer
|
import org.jetbrains.jet.utils.Printer
|
||||||
import org.jetbrains.jet.lang.resolve.java.descriptor.JavaPackageFragmentDescriptor
|
import org.jetbrains.jet.lang.resolve.java.descriptor.JavaPackageFragmentDescriptor
|
||||||
import org.jetbrains.jet.lang.resolve.java.structure.JavaPropertyInitializerEvaluator
|
import org.jetbrains.jet.lang.resolve.java.structure.JavaPropertyInitializerEvaluator
|
||||||
|
import org.jetbrains.jet.utils.*
|
||||||
|
|
||||||
public abstract class LazyJavaMemberScope(
|
public abstract class LazyJavaMemberScope(
|
||||||
protected val c: LazyJavaResolverContextWithTypes,
|
protected val c: LazyJavaResolverContextWithTypes,
|
||||||
@@ -166,7 +167,7 @@ public abstract class LazyJavaMemberScope(
|
|||||||
function: FunctionDescriptor,
|
function: FunctionDescriptor,
|
||||||
jValueParameters: List<JavaValueParameter>
|
jValueParameters: List<JavaValueParameter>
|
||||||
): List<ValueParameterDescriptor> {
|
): List<ValueParameterDescriptor> {
|
||||||
return jValueParameters.withIndices().map {
|
return jValueParameters.withIndices_tmp().map_tmp {
|
||||||
pair ->
|
pair ->
|
||||||
val (index, javaParameter) = pair
|
val (index, javaParameter) = pair
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -33,6 +33,7 @@ import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns
|
|||||||
import org.jetbrains.jet.lang.resolve.java.structure.JavaTypeParameter
|
import org.jetbrains.jet.lang.resolve.java.structure.JavaTypeParameter
|
||||||
import org.jetbrains.jet.lang.resolve.java.structure.JavaClass
|
import org.jetbrains.jet.lang.resolve.java.structure.JavaClass
|
||||||
import org.jetbrains.kotlin.util.sure
|
import org.jetbrains.kotlin.util.sure
|
||||||
|
import org.jetbrains.jet.utils.*
|
||||||
import org.jetbrains.jet.lang.resolve.java.lazy.descriptors.LazyJavaTypeParameterDescriptor
|
import org.jetbrains.jet.lang.resolve.java.lazy.descriptors.LazyJavaTypeParameterDescriptor
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope
|
import org.jetbrains.jet.lang.resolve.scopes.JetScope
|
||||||
import org.jetbrains.jet.lang.resolve.java.structure.JavaAnnotationOwner
|
import org.jetbrains.jet.lang.resolve.java.structure.JavaAnnotationOwner
|
||||||
@@ -194,7 +195,7 @@ class LazyJavaTypeResolver(
|
|||||||
return typeParameters.map { p -> TypeProjectionImpl(ErrorUtils.createErrorType(p.getName().asString())) }
|
return typeParameters.map { p -> TypeProjectionImpl(ErrorUtils.createErrorType(p.getName().asString())) }
|
||||||
}
|
}
|
||||||
var howTheProjectionIsUsed = if (attr.howThisTypeIsUsed == SUPERTYPE) SUPERTYPE_ARGUMENT else TYPE_ARGUMENT
|
var howTheProjectionIsUsed = if (attr.howThisTypeIsUsed == SUPERTYPE) SUPERTYPE_ARGUMENT else TYPE_ARGUMENT
|
||||||
return javaType.getTypeArguments().withIndices().map {
|
return javaType.getTypeArguments().withIndices_tmp().map_tmp {
|
||||||
javaTypeParameter ->
|
javaTypeParameter ->
|
||||||
val (i, t) = javaTypeParameter
|
val (i, t) = javaTypeParameter
|
||||||
val parameter = if (i >= typeParameters.size)
|
val parameter = if (i >= typeParameters.size)
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package org.jetbrains.jet.utils
|
||||||
|
|
||||||
|
import java.util.ArrayList
|
||||||
|
import kotlin.support.AbstractIterator
|
||||||
|
|
||||||
|
//TODO: Remove after updating to new stdlib
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
fun <T: Any> Iterable<T>.firstOrNull_tmp() : T? {
|
||||||
|
val iterator = this.iterator()
|
||||||
|
return if (iterator.hasNext()) iterator.next() else null
|
||||||
|
}
|
||||||
|
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
public inline fun <K, V> Map<K,V>.filter_tmp(predicate: (Map.Entry<K,V>)->Boolean) : List<Map.Entry<K,V>> {
|
||||||
|
return filterTo_tmp(ArrayList<Map.Entry<K,V>>(), predicate)
|
||||||
|
}
|
||||||
|
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
public inline fun <K, V, C: MutableCollection<in Map.Entry<K,V>>> Map<K,V>.filterTo_tmp(collection: C, predicate: (Map.Entry<K,V>) -> Boolean) : C {
|
||||||
|
for (element in this) if (predicate(element)) collection.add(element)
|
||||||
|
return collection
|
||||||
|
}
|
||||||
|
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
public fun <T, S> Iterator<T>.zip_tmp(iterator: Iterator<S>): Iterator<Pair<T, S>> = PairIterator_tmp(this, iterator)
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
public fun <T, S> Iterable<T>.zip_tmp(second: Iterable<S>): Iterable<Pair<T, S>> {
|
||||||
|
val list = ArrayList<Pair<T,S>>()
|
||||||
|
for (item in iterator().zip_tmp(second.iterator())) {
|
||||||
|
list.add(item)
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
public fun <T, R> Iterator<T>.map_tmp(transform : (T) -> R) : Iterator<R> {
|
||||||
|
return MapIterator_tmp<T, R>(this, transform)
|
||||||
|
}
|
||||||
|
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
class MapIterator_tmp<T, R>(val iterator : Iterator<T>, val transform: (T) -> R) : AbstractIterator<R>() {
|
||||||
|
override protected fun computeNext() : Unit {
|
||||||
|
if (iterator.hasNext()) {
|
||||||
|
setNext((transform)(iterator.next()))
|
||||||
|
} else {
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
public fun <T> Iterable<T>.withIndices_tmp() : Iterator<Pair<Int, T>> {
|
||||||
|
return IndexIterator_tmp(iterator())
|
||||||
|
}
|
||||||
|
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
public fun <T> Array<out T>.withIndices_tmp() : Iterator<Pair<Int, T>> {
|
||||||
|
return IndexIterator_tmp(iterator())
|
||||||
|
}
|
||||||
|
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
class IndexIterator_tmp<T>(val iterator : Iterator<T>): Iterator<Pair<Int, T>> {
|
||||||
|
private var index : Int = 0
|
||||||
|
|
||||||
|
override fun next(): Pair<Int, T> {
|
||||||
|
return Pair(index++, iterator.next())
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hasNext(): Boolean {
|
||||||
|
return iterator.hasNext()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[deprecated("use streams instead")]
|
||||||
|
public class PairIterator_tmp<T, S>(
|
||||||
|
val iterator1 : Iterator<T>, val iterator2 : Iterator<S>
|
||||||
|
): AbstractIterator<Pair<T, S>>() {
|
||||||
|
protected override fun computeNext() {
|
||||||
|
if (iterator1.hasNext() && iterator2.hasNext()) {
|
||||||
|
setNext(Pair(iterator1.next(), iterator2.next()))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -60,6 +60,8 @@ import org.jetbrains.jet.lang.psi.JetTypeReference
|
|||||||
import com.intellij.util.containers.ContainerUtil
|
import com.intellij.util.containers.ContainerUtil
|
||||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils
|
import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils
|
||||||
import org.jetbrains.jet.plugin.imports.*
|
import org.jetbrains.jet.plugin.imports.*
|
||||||
|
import org.jetbrains.jet.lang.descriptors.PackageViewDescriptor
|
||||||
|
import org.jetbrains.jet.utils.*
|
||||||
|
|
||||||
//NOTE: this class is based on CopyPasteReferenceProcessor and JavaCopyPasteReferenceProcessor
|
//NOTE: this class is based on CopyPasteReferenceProcessor and JavaCopyPasteReferenceProcessor
|
||||||
public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<ReferenceTransferableData?> {
|
public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<ReferenceTransferableData?> {
|
||||||
@@ -340,9 +342,9 @@ public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<Refere
|
|||||||
private val ReferenceData.fqName: FqName
|
private val ReferenceData.fqName: FqName
|
||||||
get() = FqName(qClassName!!)
|
get() = FqName(qClassName!!)
|
||||||
|
|
||||||
private fun zip(first: IntArray, second: IntArray): Iterator<Pair<Int, Int>> {
|
private fun zip(first: IntArray, second: IntArray): Iterable<Pair<Int, Int>> {
|
||||||
assert(first.size == second.size)
|
assert(first.size == second.size)
|
||||||
return first.iterator().zip(second.iterator())
|
return first.toList().zip_tmp(second.toList())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun PsiElement.isInCopiedArea(fileCopiedFrom: JetFile, startOffsets: IntArray, endOffsets: IntArray): Boolean {
|
private fun PsiElement.isInCopiedArea(fileCopiedFrom: JetFile, startOffsets: IntArray, endOffsets: IntArray): Boolean {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import com.intellij.psi.PsiDocumentManager
|
|||||||
import com.intellij.openapi.application.ApplicationManager
|
import com.intellij.openapi.application.ApplicationManager
|
||||||
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache
|
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache
|
||||||
import org.jetbrains.jet.plugin.codeInsight.ShortenReferences
|
import org.jetbrains.jet.plugin.codeInsight.ShortenReferences
|
||||||
|
import org.jetbrains.jet.utils.*
|
||||||
|
|
||||||
trait SmartCompletionData{
|
trait SmartCompletionData{
|
||||||
fun accepts(descriptor: DeclarationDescriptor): Boolean
|
fun accepts(descriptor: DeclarationDescriptor): Boolean
|
||||||
@@ -287,8 +288,8 @@ private fun processDataFlowInfo(dataFlowInfo: DataFlowInfo?, receiver: JetExpres
|
|||||||
}
|
}
|
||||||
|
|
||||||
val nullabilityInfo: Map<DataFlowValue, Nullability> = dataFlowInfo.getCompleteNullabilityInfo()
|
val nullabilityInfo: Map<DataFlowValue, Nullability> = dataFlowInfo.getCompleteNullabilityInfo()
|
||||||
val notNullVariables = nullabilityInfo.iterator()
|
val notNullVariables = nullabilityInfo
|
||||||
.filter { it.getValue() == Nullability.NOT_NULL }
|
.filter_tmp { it.getValue() == Nullability.NOT_NULL }
|
||||||
.map { dataFlowValueToVariable(it.getKey()) }
|
.map { dataFlowValueToVariable(it.getKey()) }
|
||||||
.filterNotNullTo(HashSet<VariableDescriptor>())
|
.filterNotNullTo(HashSet<VariableDescriptor>())
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -30,8 +30,8 @@ import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache
|
|||||||
import org.jetbrains.jet.lang.descriptors.impl.AnonymousFunctionDescriptor
|
import org.jetbrains.jet.lang.descriptors.impl.AnonymousFunctionDescriptor
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
||||||
import org.jetbrains.jet.plugin.references.JetReference
|
import org.jetbrains.jet.plugin.references.JetReference
|
||||||
import org.jetbrains.jet.plugin.codeInsight.firstOrNull
|
|
||||||
import org.jetbrains.jet.lang.descriptors.VariableDescriptor
|
import org.jetbrains.jet.lang.descriptors.VariableDescriptor
|
||||||
|
import org.jetbrains.jet.utils.firstOrNull_tmp
|
||||||
|
|
||||||
public class ReplaceExplicitFunctionLiteralParamWithItIntention() : PsiElementBaseIntentionAction() {
|
public class ReplaceExplicitFunctionLiteralParamWithItIntention() : PsiElementBaseIntentionAction() {
|
||||||
override fun invoke(project: Project, editor: Editor, element: PsiElement) {
|
override fun invoke(project: Project, editor: Editor, element: PsiElement) {
|
||||||
@@ -75,7 +75,7 @@ public class ReplaceExplicitFunctionLiteralParamWithItIntention() : PsiElementBa
|
|||||||
}
|
}
|
||||||
is JetSimpleNameExpression -> {
|
is JetSimpleNameExpression -> {
|
||||||
val reference = expression.getReference() as JetReference?
|
val reference = expression.getReference() as JetReference?
|
||||||
val variableDescriptor = reference?.resolveToDescriptors()?.firstOrNull() as? VariableDescriptor?
|
val variableDescriptor = reference?.resolveToDescriptors()?.firstOrNull_tmp() as? VariableDescriptor?
|
||||||
if (variableDescriptor != null) {
|
if (variableDescriptor != null) {
|
||||||
val containingDescriptor = variableDescriptor.getContainingDeclaration()
|
val containingDescriptor = variableDescriptor.getContainingDeclaration()
|
||||||
if (containingDescriptor is AnonymousFunctionDescriptor) {
|
if (containingDescriptor is AnonymousFunctionDescriptor) {
|
||||||
|
|||||||
+2
-2
@@ -33,7 +33,7 @@ import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor
|
|||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
||||||
import org.jetbrains.jet.lang.psi.JetFunctionLiteral
|
import org.jetbrains.jet.lang.psi.JetFunctionLiteral
|
||||||
import org.jetbrains.jet.plugin.references.JetReference
|
import org.jetbrains.jet.plugin.references.JetReference
|
||||||
import org.jetbrains.jet.plugin.codeInsight.firstOrNull
|
import org.jetbrains.jet.utils.firstOrNull_tmp
|
||||||
|
|
||||||
public class ReplaceItWithExplicitFunctionLiteralParamIntention() : PsiElementBaseIntentionAction() {
|
public class ReplaceItWithExplicitFunctionLiteralParamIntention() : PsiElementBaseIntentionAction() {
|
||||||
override fun invoke(project: Project, editor: Editor, element: PsiElement) {
|
override fun invoke(project: Project, editor: Editor, element: PsiElement) {
|
||||||
@@ -64,7 +64,7 @@ public class ReplaceItWithExplicitFunctionLiteralParamIntention() : PsiElementBa
|
|||||||
|
|
||||||
val bindingContext = AnalyzerFacadeWithCache.getContextForElement(simpleNameExpression)
|
val bindingContext = AnalyzerFacadeWithCache.getContextForElement(simpleNameExpression)
|
||||||
val reference = simpleNameExpression.getReference() as JetReference?
|
val reference = simpleNameExpression.getReference() as JetReference?
|
||||||
val simpleNameTarget = reference?.resolveToDescriptors()?.firstOrNull() as? ValueParameterDescriptor?
|
val simpleNameTarget = reference?.resolveToDescriptors()?.firstOrNull_tmp() as? ValueParameterDescriptor?
|
||||||
if (simpleNameTarget == null || bindingContext.get(BindingContext.AUTO_CREATED_IT, simpleNameTarget) != true) {
|
if (simpleNameTarget == null || bindingContext.get(BindingContext.AUTO_CREATED_IT, simpleNameTarget) != true) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-7
@@ -27,6 +27,7 @@ import com.intellij.psi.util.PsiTreeUtil
|
|||||||
import com.intellij.psi.PsiWhiteSpace
|
import com.intellij.psi.PsiWhiteSpace
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
import com.intellij.util.containers.ContainerUtil
|
import com.intellij.util.containers.ContainerUtil
|
||||||
|
import org.jetbrains.jet.utils.*
|
||||||
|
|
||||||
public val TRANSFORM_WITHOUT_CHECK: String = "Expression must be checked before applying transformation"
|
public val TRANSFORM_WITHOUT_CHECK: String = "Expression must be checked before applying transformation"
|
||||||
|
|
||||||
@@ -325,17 +326,17 @@ public fun JetWhenExpression.canMergeWithNext(): Boolean {
|
|||||||
fun checkConditions(e1: JetWhenEntry, e2: JetWhenEntry): Boolean {
|
fun checkConditions(e1: JetWhenEntry, e2: JetWhenEntry): Boolean {
|
||||||
if (e1.isElse() != e2.isElse()) return false
|
if (e1.isElse() != e2.isElse()) return false
|
||||||
|
|
||||||
val conditions1 = e1.getConditions()
|
val conditions1 = e1.getConditions().toList()
|
||||||
val conditions2 = e2.getConditions()
|
val conditions2 = e2.getConditions().toList()
|
||||||
return conditions1.size == conditions2.size &&
|
return conditions1.size == conditions2.size &&
|
||||||
(conditions1.iterator() zip conditions2.iterator()).all { pair -> JetPsiMatcher.checkElementMatch(pair.first, pair.second)}
|
(conditions1 zip_tmp conditions2).all { pair -> JetPsiMatcher.checkElementMatch(pair.first, pair.second)}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun JetWhenEntry.declarationNames(): Set<String> =
|
fun JetWhenEntry.declarationNames(): Set<String> =
|
||||||
getExpression()?.blockExpressionsOrSingle()
|
getExpression()?.blockExpressionsOrSingle()
|
||||||
?.filterIsInstance(javaClass<JetNamedDeclaration>())
|
?.filter { it is JetNamedDeclaration }
|
||||||
?.map { decl -> decl.getName() }
|
?.map { decl -> decl.getName() }
|
||||||
?.filterNotNull()?.toHashSet() ?: Collections.emptySet<String>()
|
?.filterNotNull()?.toSet() ?: Collections.emptySet<String>()
|
||||||
|
|
||||||
fun checkBodies(e1: JetWhenEntry, e2: JetWhenEntry): Boolean {
|
fun checkBodies(e1: JetWhenEntry, e2: JetWhenEntry): Boolean {
|
||||||
if (ContainerUtil.intersects(e1.declarationNames(), e2.declarationNames())) return false
|
if (ContainerUtil.intersects(e1.declarationNames(), e2.declarationNames())) return false
|
||||||
@@ -353,7 +354,7 @@ public fun JetWhenExpression.canMergeWithNext(): Boolean {
|
|||||||
|
|
||||||
val entries1 = getEntries()
|
val entries1 = getEntries()
|
||||||
val entries2 = sibling.getEntries()
|
val entries2 = sibling.getEntries()
|
||||||
return entries1.size == entries2.size && (entries1.iterator() zip entries2.iterator()).all { pair ->
|
return entries1.size == entries2.size && (entries1 zip_tmp entries2).all { pair ->
|
||||||
checkConditions(pair.first, pair.second) && checkBodies(pair.first, pair.second)
|
checkConditions(pair.first, pair.second) && checkBodies(pair.first, pair.second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -373,7 +374,7 @@ public fun JetWhenExpression.mergeWithNext() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val sibling = PsiTreeUtil.skipSiblingsForward(this, javaClass<PsiWhiteSpace>()) as JetWhenExpression
|
val sibling = PsiTreeUtil.skipSiblingsForward(this, javaClass<PsiWhiteSpace>()) as JetWhenExpression
|
||||||
for ((entry1, entry2) in getEntries().iterator() zip sibling.getEntries().iterator()) {
|
for ((entry1, entry2) in getEntries() zip_tmp sibling.getEntries()) {
|
||||||
entry1.getExpression() mergeWith entry2.getExpression()
|
entry1.getExpression() mergeWith entry2.getExpression()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import org.jetbrains.jet.lang.parsing.JetExpressionParsing
|
|||||||
import java.util.HashMap
|
import java.util.HashMap
|
||||||
import org.jetbrains.jet.lang.parsing.JetExpressionParsing.Precedence.*
|
import org.jetbrains.jet.lang.parsing.JetExpressionParsing.Precedence.*
|
||||||
import org.jetbrains.jet.lang.psi.*
|
import org.jetbrains.jet.lang.psi.*
|
||||||
|
import org.jetbrains.jet.utils.*
|
||||||
|
|
||||||
public object JetPsiPrecedences {
|
public object JetPsiPrecedences {
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ public object JetPsiPrecedences {
|
|||||||
private val precedence: Map<IElementType, Int>
|
private val precedence: Map<IElementType, Int>
|
||||||
{
|
{
|
||||||
val builder = HashMap<IElementType, Int>()
|
val builder = HashMap<IElementType, Int>()
|
||||||
for ((i, record) in JetExpressionParsing.Precedence.values().withIndices()) {
|
for ((i, record) in JetExpressionParsing.Precedence.values().withIndices_tmp()) {
|
||||||
for (elementType in record.getOperations().getTypes()) {
|
for (elementType in record.getOperations().getTypes()) {
|
||||||
builder[elementType] = i
|
builder[elementType] = i
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user