Enum warnings fixed: deprecated delimiters, short super constructors, both in project and in libraries
This commit is contained in:
@@ -21,8 +21,8 @@ import org.jetbrains.org.objectweb.asm.tree.LabelNode
|
||||
import org.jetbrains.kotlin.codegen.inline.InlineCodegenUtil.*
|
||||
|
||||
enum class TryCatchPosition {
|
||||
START
|
||||
END
|
||||
START,
|
||||
END,
|
||||
INNER
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import kotlin.properties.Delegates
|
||||
|
||||
public data class JavaRoot(public val file: VirtualFile, public val type: JavaRoot.RootType) {
|
||||
public enum class RootType {
|
||||
SOURCE
|
||||
SOURCE,
|
||||
BINARY
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -27,18 +27,18 @@ import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKind.*
|
||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
|
||||
public enum class MemberKind { FIELD METHOD }
|
||||
public enum class MemberKind { FIELD, METHOD }
|
||||
|
||||
public data class RawSignature(public val name: String, public val desc: String, public val kind: MemberKind)
|
||||
|
||||
public enum class JvmDeclarationOriginKind {
|
||||
OTHER
|
||||
PACKAGE_FACADE
|
||||
PACKAGE_PART
|
||||
TRAIT_IMPL
|
||||
DELEGATION_TO_TRAIT_IMPL
|
||||
DELEGATION
|
||||
BRIDGE
|
||||
OTHER,
|
||||
PACKAGE_FACADE,
|
||||
PACKAGE_PART,
|
||||
TRAIT_IMPL,
|
||||
DELEGATION_TO_TRAIT_IMPL,
|
||||
DELEGATION,
|
||||
BRIDGE,
|
||||
SYNTHETIC // this means that there's no proper descriptor for this jvm declaration
|
||||
}
|
||||
|
||||
|
||||
@@ -102,12 +102,12 @@ public trait ModuleInfo {
|
||||
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
},
|
||||
LAST {
|
||||
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
|
||||
dependencies.add(builtinsModule)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
|
||||
//TODO: KT-5457
|
||||
|
||||
@@ -190,7 +190,7 @@ public fun traverseFollowingInstructions(
|
||||
}
|
||||
|
||||
public enum class TraversalOrder {
|
||||
FORWARD
|
||||
FORWARD,
|
||||
BACKWARD
|
||||
}
|
||||
|
||||
|
||||
+15
-15
@@ -132,23 +132,23 @@ public class MagicInstruction(
|
||||
|
||||
public enum class MagicKind(val sideEffectFree: Boolean = false) {
|
||||
// builtin operations
|
||||
STRING_TEMPLATE: MagicKind(true)
|
||||
AND: MagicKind(true)
|
||||
OR: MagicKind(true)
|
||||
NOT_NULL_ASSERTION: MagicKind()
|
||||
EQUALS_IN_WHEN_CONDITION: MagicKind()
|
||||
IS: MagicKind()
|
||||
CAST: MagicKind()
|
||||
CALLABLE_REFERENCE: MagicKind(true)
|
||||
STRING_TEMPLATE(true),
|
||||
AND(true),
|
||||
OR(true),
|
||||
NOT_NULL_ASSERTION(),
|
||||
EQUALS_IN_WHEN_CONDITION(),
|
||||
IS(),
|
||||
CAST(),
|
||||
CALLABLE_REFERENCE(true),
|
||||
// implicit operations
|
||||
LOOP_RANGE_ITERATION: MagicKind()
|
||||
IMPLICIT_RECEIVER: MagicKind()
|
||||
VALUE_CONSUMER: MagicKind()
|
||||
LOOP_RANGE_ITERATION(),
|
||||
IMPLICIT_RECEIVER(),
|
||||
VALUE_CONSUMER(),
|
||||
// unrecognized operations
|
||||
UNRESOLVED_CALL: MagicKind()
|
||||
UNSUPPORTED_ELEMENT: MagicKind()
|
||||
UNRECOGNIZED_WRITE_RHS: MagicKind()
|
||||
FAKE_INITIALIZER: MagicKind()
|
||||
UNRESOLVED_CALL(),
|
||||
UNSUPPORTED_ELEMENT(),
|
||||
UNRECOGNIZED_WRITE_RHS(),
|
||||
FAKE_INITIALIZER()
|
||||
}
|
||||
|
||||
// Merges values produced by alternative control-flow paths (such as 'if' branches)
|
||||
|
||||
@@ -374,18 +374,18 @@ public class JetPsiFactory(private val project: Project) {
|
||||
|
||||
public class CallableBuilder(private val target: Target) {
|
||||
public enum class Target {
|
||||
FUNCTION
|
||||
FUNCTION,
|
||||
READ_ONLY_PROPERTY
|
||||
}
|
||||
|
||||
enum class State {
|
||||
MODIFIERS
|
||||
NAME
|
||||
RECEIVER
|
||||
FIRST_PARAM
|
||||
REST_PARAMS
|
||||
TYPE_CONSTRAINTS
|
||||
BODY
|
||||
MODIFIERS,
|
||||
NAME,
|
||||
RECEIVER,
|
||||
FIRST_PARAM,
|
||||
REST_PARAMS,
|
||||
TYPE_CONSTRAINTS,
|
||||
BODY,
|
||||
DONE
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@ public object ArgumentUnmapped: ArgumentMapping {
|
||||
}
|
||||
|
||||
public enum class ArgumentMatchStatus(val isError: Boolean = true) {
|
||||
SUCCESS : ArgumentMatchStatus(false)
|
||||
TYPE_MISMATCH : ArgumentMatchStatus()
|
||||
ARGUMENT_HAS_NO_TYPE : ArgumentMatchStatus()
|
||||
SUCCESS(false),
|
||||
TYPE_MISMATCH(),
|
||||
ARGUMENT_HAS_NO_TYPE(),
|
||||
|
||||
// The case when there is no type mismatch, but parameter has uninferred types:
|
||||
// fun <T> foo(l: List<T>) {}; val l = foo(emptyList())
|
||||
MATCH_MODULO_UNINFERRED_TYPES : ArgumentMatchStatus()
|
||||
MATCH_MODULO_UNINFERRED_TYPES()
|
||||
}
|
||||
|
||||
public trait ArgumentMatch : ArgumentMapping {
|
||||
|
||||
@@ -226,8 +226,8 @@ class LazyImportScope(
|
||||
) : JetScope {
|
||||
|
||||
enum class FilteringKind {
|
||||
ALL
|
||||
VISIBLE_CLASSES
|
||||
ALL,
|
||||
VISIBLE_CLASSES,
|
||||
INVISIBLE_CLASSES
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ import org.jetbrains.kotlin.name.Name
|
||||
|
||||
public trait WritableScope : JetScope {
|
||||
public enum class LockLevel {
|
||||
WRITING
|
||||
BOTH
|
||||
WRITING,
|
||||
BOTH,
|
||||
READING
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ abstract public class AbstractConstraintSystemTest() : JetLiteFixture() {
|
||||
|
||||
class MyConstraint(val kind: MyConstraintKind, val firstType: String, val secondType: String, val isWeak: Boolean)
|
||||
enum class MyConstraintKind {
|
||||
SUBTYPE SUPERTYPE
|
||||
SUBTYPE, SUPERTYPE
|
||||
}
|
||||
|
||||
private fun parseVariables(text: String): List<String> {
|
||||
|
||||
+2
-2
@@ -357,8 +357,8 @@ trait JavaTypeAttributes {
|
||||
}
|
||||
|
||||
enum class JavaTypeFlexibility {
|
||||
INFLEXIBLE
|
||||
FLEXIBLE_UPPER_BOUND
|
||||
INFLEXIBLE,
|
||||
FLEXIBLE_UPPER_BOUND,
|
||||
FLEXIBLE_LOWER_BOUND
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ public class KotlinClassHeader(
|
||||
}
|
||||
|
||||
public enum class Kind {
|
||||
CLASS
|
||||
PACKAGE_FACADE
|
||||
CLASS,
|
||||
PACKAGE_FACADE,
|
||||
SYNTHETIC_CLASS
|
||||
}
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ public fun FqName.tail(prefix: FqName): FqName {
|
||||
}
|
||||
|
||||
private enum class State {
|
||||
BEGINNING
|
||||
MIDDLE
|
||||
BEGINNING,
|
||||
MIDDLE,
|
||||
AFTER_DOT
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -19,13 +19,13 @@ package org.jetbrains.kotlin.resolve.calls.inference.constraintPosition
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.constraintPosition.ConstraintPositionKind.*
|
||||
|
||||
public enum class ConstraintPositionKind {
|
||||
RECEIVER_POSITION
|
||||
EXPECTED_TYPE_POSITION
|
||||
VALUE_PARAMETER_POSITION
|
||||
TYPE_BOUND_POSITION
|
||||
COMPOUND_CONSTRAINT_POSITION
|
||||
FROM_COMPLETER
|
||||
SPECIAL
|
||||
RECEIVER_POSITION,
|
||||
EXPECTED_TYPE_POSITION,
|
||||
VALUE_PARAMETER_POSITION,
|
||||
TYPE_BOUND_POSITION,
|
||||
COMPOUND_CONSTRAINT_POSITION,
|
||||
FROM_COMPLETER,
|
||||
SPECIAL;
|
||||
|
||||
public fun position(): ConstraintPosition {
|
||||
assert(this in setOf(RECEIVER_POSITION, EXPECTED_TYPE_POSITION, FROM_COMPLETER, SPECIAL))
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ import org.jetbrains.kotlin.types.TypeSubstitution
|
||||
public class ConstraintSystemImpl : ConstraintSystem {
|
||||
|
||||
public enum class ConstraintKind {
|
||||
SUB_TYPE
|
||||
SUB_TYPE,
|
||||
EQUAL
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ public trait TypeBounds {
|
||||
public fun getValues(): Collection<JetType>
|
||||
|
||||
public enum class BoundKind {
|
||||
LOWER_BOUND
|
||||
UPPER_BOUND
|
||||
LOWER_BOUND,
|
||||
UPPER_BOUND,
|
||||
EXACT_BOUND
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ public trait TypeCapability
|
||||
public trait Specificity : TypeCapability {
|
||||
|
||||
public enum class Relation {
|
||||
LESS_SPECIFIC
|
||||
MORE_SPECIFIC
|
||||
LESS_SPECIFIC,
|
||||
MORE_SPECIFIC,
|
||||
DONT_KNOW
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ public enum class Variance(
|
||||
public val allowsOutPosition: Boolean,
|
||||
private val superpositionFactor: Int
|
||||
) {
|
||||
INVARIANT : Variance("", true, true, 0)
|
||||
IN_VARIANCE : Variance("in", true, false, -1)
|
||||
OUT_VARIANCE : Variance("out", false, true, +1)
|
||||
INVARIANT("", true, true, 0),
|
||||
IN_VARIANCE("in", true, false, -1),
|
||||
OUT_VARIANCE("out", false, true, +1);
|
||||
|
||||
public fun allowsPosition(position: Variance): Boolean
|
||||
= when (position) {
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public abstract class DeserializedMemberScope protected(
|
||||
) : JetScope {
|
||||
|
||||
private data class ProtoKey(val name: Name, val kind: Kind, val isExtension: Boolean)
|
||||
private enum class Kind { FUNCTION PROPERTY }
|
||||
private enum class Kind { FUNCTION, PROPERTY }
|
||||
|
||||
private fun CallableKind.toKind(): Kind {
|
||||
return when (this) {
|
||||
|
||||
@@ -32,8 +32,8 @@ public class ExceptionThrown(public val exception: ObjectValue, public val kind:
|
||||
override fun toString(): String = "Thrown $exception: $kind"
|
||||
|
||||
public enum class ExceptionKind {
|
||||
FROM_EVALUATED_CODE
|
||||
FROM_EVALUATOR
|
||||
FROM_EVALUATED_CODE,
|
||||
FROM_EVALUATOR,
|
||||
BROKEN_CODE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,14 +20,14 @@ import org.jetbrains.kotlin.generators.builtins.ProgressionKind.*
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
enum class PrimitiveType {
|
||||
BYTE
|
||||
CHAR
|
||||
SHORT
|
||||
INT
|
||||
LONG
|
||||
FLOAT
|
||||
DOUBLE
|
||||
BOOLEAN
|
||||
BYTE,
|
||||
CHAR,
|
||||
SHORT,
|
||||
INT,
|
||||
LONG,
|
||||
FLOAT,
|
||||
DOUBLE,
|
||||
BOOLEAN;
|
||||
|
||||
val capitalized: String get() = name().toLowerCase().capitalize()
|
||||
companion object {
|
||||
@@ -36,13 +36,13 @@ enum class PrimitiveType {
|
||||
}
|
||||
|
||||
enum class ProgressionKind {
|
||||
BYTE
|
||||
CHAR
|
||||
SHORT
|
||||
INT
|
||||
LONG
|
||||
FLOAT
|
||||
DOUBLE
|
||||
BYTE,
|
||||
CHAR,
|
||||
SHORT,
|
||||
INT,
|
||||
LONG,
|
||||
FLOAT,
|
||||
DOUBLE;
|
||||
|
||||
val capitalized: String get() = name().toLowerCase().capitalize()
|
||||
}
|
||||
|
||||
@@ -28,12 +28,12 @@ enum class FunctionKind(
|
||||
val hasReceiverParameter: Boolean,
|
||||
private val superClassNamePrefix: String?
|
||||
) {
|
||||
FUNCTION : FunctionKind("Function", "A function", false, null)
|
||||
EXTENSION_FUNCTION : FunctionKind("ExtensionFunction", "An extension function", true, null)
|
||||
FUNCTION("Function", "A function", false, null),
|
||||
EXTENSION_FUNCTION("ExtensionFunction", "An extension function", true, null),
|
||||
|
||||
K_FUNCTION : FunctionKind("KFunction", "A function with introspection capabilities", false, "Function")
|
||||
K_MEMBER_FUNCTION : FunctionKind("KMemberFunction", "A member function with introspection capabilities", true, "ExtensionFunction")
|
||||
K_EXTENSION_FUNCTION : FunctionKind("KExtensionFunction", "An extension function with introspection capabilities", true, "ExtensionFunction")
|
||||
K_FUNCTION("KFunction", "A function with introspection capabilities", false, "Function"),
|
||||
K_MEMBER_FUNCTION("KMemberFunction", "A member function with introspection capabilities", true, "ExtensionFunction"),
|
||||
K_EXTENSION_FUNCTION("KExtensionFunction", "An extension function with introspection capabilities", true, "ExtensionFunction");
|
||||
|
||||
fun getFileName() = (if (isReflection()) "reflect/" else "") + classNamePrefix + "s.kt"
|
||||
fun getClassName(i: Int) = classNamePrefix + i
|
||||
|
||||
@@ -81,7 +81,7 @@ class FuzzyType(
|
||||
= matchedSubstitutor(otherType, MatchKind.IS_SUPERTYPE)
|
||||
|
||||
private enum class MatchKind {
|
||||
IS_SUBTYPE
|
||||
IS_SUBTYPE,
|
||||
IS_SUPERTYPE
|
||||
}
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ private fun JetType.hasAnnotationMaybeExternal(fqName: FqName) = with (getAnnota
|
||||
} != null
|
||||
|
||||
public enum class TypeNullability {
|
||||
NOT_NULL
|
||||
NULLABLE
|
||||
NOT_NULL,
|
||||
NULLABLE,
|
||||
FLEXIBLE
|
||||
}
|
||||
|
||||
|
||||
@@ -26,18 +26,18 @@ import org.jetbrains.kotlin.resolve.calls.smartcasts.SmartCastUtils
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
|
||||
public enum class CallType {
|
||||
NORMAL
|
||||
SAFE
|
||||
NORMAL,
|
||||
SAFE,
|
||||
|
||||
INFIX {
|
||||
override fun canCall(descriptor: DeclarationDescriptor)
|
||||
= descriptor is SimpleFunctionDescriptor && descriptor.getValueParameters().size() == 1
|
||||
}
|
||||
},
|
||||
|
||||
UNARY {
|
||||
override fun canCall(descriptor: DeclarationDescriptor)
|
||||
= descriptor is SimpleFunctionDescriptor && descriptor.getValueParameters().size() == 0
|
||||
}
|
||||
};
|
||||
|
||||
public open fun canCall(descriptor: DeclarationDescriptor): Boolean = true
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.jetbrains.kotlin.resolve.lazy
|
||||
|
||||
public enum class BodyResolveMode {
|
||||
FULL
|
||||
PARTIAL
|
||||
FULL,
|
||||
PARTIAL,
|
||||
PARTIAL_FOR_COMPLETION
|
||||
}
|
||||
|
||||
@@ -531,9 +531,9 @@ class PartialBodyResolveFilter(
|
||||
}
|
||||
|
||||
private enum class MarkLevel {
|
||||
SKIP
|
||||
TAKE
|
||||
NEED_REFERENCE_RESOLVE
|
||||
SKIP,
|
||||
TAKE,
|
||||
NEED_REFERENCE_RESOLVE,
|
||||
NEED_COMPLETION
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class ModuleTypeCacheManager private (project: Project) {
|
||||
}
|
||||
|
||||
enum class ModuleType {
|
||||
GRADLE
|
||||
GRADLE,
|
||||
OTHER
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -118,7 +118,7 @@ enum class FlagsToModifiers {
|
||||
else -> throw IllegalStateException("Unexpected modality: $modality")
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
VISIBILITY {
|
||||
override fun getModifiers(flags: Int): JetModifierKeywordToken? {
|
||||
@@ -131,13 +131,13 @@ enum class FlagsToModifiers {
|
||||
else -> throw IllegalStateException("Unexpected visibility: $visibility")
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
INNER {
|
||||
override fun getModifiers(flags: Int): JetModifierKeywordToken? {
|
||||
return if (Flags.INNER.get(flags)) JetTokens.INNER_KEYWORD else null
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
abstract fun getModifiers(flags: Int): JetModifierKeywordToken?
|
||||
}
|
||||
|
||||
@@ -224,39 +224,39 @@ public object UsageTypeUtils {
|
||||
}
|
||||
|
||||
enum class UsageTypeEnum {
|
||||
TYPE_CONSTRAINT
|
||||
VALUE_PARAMETER_TYPE
|
||||
NON_LOCAL_PROPERTY_TYPE
|
||||
FUNCTION_RETURN_TYPE
|
||||
SUPER_TYPE
|
||||
TYPE_DEFINITION
|
||||
IS
|
||||
CLASS_OBJECT_ACCESS
|
||||
COMPANION_OBJECT_ACCESS
|
||||
EXTENSION_RECEIVER_TYPE
|
||||
SUPER_TYPE_QUALIFIER
|
||||
TYPE_CONSTRAINT,
|
||||
VALUE_PARAMETER_TYPE,
|
||||
NON_LOCAL_PROPERTY_TYPE,
|
||||
FUNCTION_RETURN_TYPE,
|
||||
SUPER_TYPE,
|
||||
TYPE_DEFINITION,
|
||||
IS,
|
||||
CLASS_OBJECT_ACCESS,
|
||||
COMPANION_OBJECT_ACCESS,
|
||||
EXTENSION_RECEIVER_TYPE,
|
||||
SUPER_TYPE_QUALIFIER,
|
||||
|
||||
FUNCTION_CALL
|
||||
IMPLICIT_GET
|
||||
IMPLICIT_SET
|
||||
IMPLICIT_INVOKE
|
||||
IMPLICIT_ITERATION
|
||||
PROPERTY_DELEGATION
|
||||
FUNCTION_CALL,
|
||||
IMPLICIT_GET,
|
||||
IMPLICIT_SET,
|
||||
IMPLICIT_INVOKE,
|
||||
IMPLICIT_ITERATION,
|
||||
PROPERTY_DELEGATION,
|
||||
|
||||
RECEIVER
|
||||
DELEGATE
|
||||
RECEIVER,
|
||||
DELEGATE,
|
||||
|
||||
PACKAGE_DIRECTIVE
|
||||
PACKAGE_MEMBER_ACCESS
|
||||
PACKAGE_DIRECTIVE,
|
||||
PACKAGE_MEMBER_ACCESS,
|
||||
|
||||
CALLABLE_REFERENCE
|
||||
CALLABLE_REFERENCE,
|
||||
|
||||
READ
|
||||
WRITE
|
||||
CLASS_IMPORT
|
||||
CLASS_LOCAL_VAR_DECLARATION
|
||||
TYPE_PARAMETER
|
||||
CLASS_CAST_TO
|
||||
ANNOTATION
|
||||
READ,
|
||||
WRITE,
|
||||
CLASS_IMPORT,
|
||||
CLASS_LOCAL_VAR_DECLARATION,
|
||||
TYPE_PARAMETER,
|
||||
CLASS_CAST_TO,
|
||||
ANNOTATION,
|
||||
CLASS_NEW_OPERATOR
|
||||
}
|
||||
|
||||
+2
-2
@@ -134,8 +134,8 @@ public class JetSimpleNameReference(
|
||||
}
|
||||
|
||||
public enum class ShorteningMode {
|
||||
NO_SHORTENING
|
||||
DELAYED_SHORTENING
|
||||
NO_SHORTENING,
|
||||
DELAYED_SHORTENING,
|
||||
FORCED_SHORTENING
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ public abstract class ImportInsertHelper {
|
||||
public abstract val importSortComparator: Comparator<ImportPath>
|
||||
|
||||
public enum class ImportDescriptorResult {
|
||||
FAIL
|
||||
IMPORT_ADDED
|
||||
FAIL,
|
||||
IMPORT_ADDED,
|
||||
ALREADY_IMPORTED
|
||||
}
|
||||
|
||||
|
||||
@@ -121,8 +121,8 @@ public class ShortenReferences(val options: (JetElement) -> Options = { Options.
|
||||
}
|
||||
|
||||
private enum class FilterResult {
|
||||
SKIP
|
||||
GO_INSIDE
|
||||
SKIP,
|
||||
GO_INSIDE,
|
||||
PROCESS
|
||||
}
|
||||
|
||||
|
||||
@@ -241,11 +241,11 @@ class BasicCompletionSession(configuration: CompletionSessionConfiguration,
|
||||
: CompletionSessionBase(configuration, parameters, resultSet) {
|
||||
|
||||
public enum class CompletionKind {
|
||||
KEYWORDS_ONLY
|
||||
NAMED_PARAMETERS_ONLY
|
||||
ALL
|
||||
TYPES
|
||||
ANNOTATION_TYPES
|
||||
KEYWORDS_ONLY,
|
||||
NAMED_PARAMETERS_ONLY,
|
||||
ALL,
|
||||
TYPES,
|
||||
ANNOTATION_TYPES,
|
||||
ANNOTATION_TYPES_OR_PARAMETER_NAME
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -69,10 +69,10 @@ private object SmartCompletionPriorityWeigher : LookupElementWeigher("kotlin.sma
|
||||
|
||||
private object KindWeigher : LookupElementWeigher("kotlin.kind") {
|
||||
private enum class Weight {
|
||||
variable // variable or property
|
||||
function
|
||||
keyword
|
||||
`default`
|
||||
variable, // variable or property
|
||||
function,
|
||||
keyword,
|
||||
`default`,
|
||||
packages
|
||||
}
|
||||
|
||||
@@ -124,13 +124,13 @@ private class JetDeclarationRemotenessWeigher(private val file: JetFile) : Looku
|
||||
private val importCache = ImportCache()
|
||||
|
||||
private enum class Weight {
|
||||
thisFile
|
||||
kotlinDefaultImport
|
||||
preciseImport
|
||||
allUnderImport
|
||||
`default`
|
||||
hasImportFromSamePackage
|
||||
notImported
|
||||
thisFile,
|
||||
kotlinDefaultImport,
|
||||
preciseImport,
|
||||
allUnderImport,
|
||||
`default`,
|
||||
hasImportFromSamePackage,
|
||||
notImported,
|
||||
notToBeUsedInKotlin
|
||||
}
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ import org.jetbrains.kotlin.types.typeUtil.equalTypesOrNulls
|
||||
import java.util.ArrayList
|
||||
|
||||
enum class ItemPriority {
|
||||
MULTIPLE_ARGUMENTS_ITEM
|
||||
DEFAULT
|
||||
BACKING_FIELD
|
||||
MULTIPLE_ARGUMENTS_ITEM,
|
||||
DEFAULT,
|
||||
BACKING_FIELD,
|
||||
NAMED_PARAMETER
|
||||
}
|
||||
|
||||
@@ -125,12 +125,12 @@ fun LookupElementPresentation.prependTailText(text: String, grayed: Boolean) {
|
||||
}
|
||||
|
||||
enum class CallableWeight {
|
||||
local // local non-extension
|
||||
thisClassMember
|
||||
baseClassMember
|
||||
thisTypeExtension
|
||||
baseTypeExtension
|
||||
global // global non-extension
|
||||
local, // local non-extension
|
||||
thisClassMember,
|
||||
baseClassMember,
|
||||
thisTypeExtension,
|
||||
baseTypeExtension,
|
||||
global, // global non-extension
|
||||
notApplicableReceiverNullable
|
||||
}
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf
|
||||
import java.util.HashSet
|
||||
|
||||
enum class Tail {
|
||||
COMMA
|
||||
RPARENTH
|
||||
COMMA,
|
||||
RPARENTH,
|
||||
ELSE
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -92,8 +92,8 @@ public class LookupElementFactory(
|
||||
}
|
||||
|
||||
private enum class Style {
|
||||
NORMAL
|
||||
BOLD
|
||||
NORMAL,
|
||||
BOLD,
|
||||
GRAYED
|
||||
}
|
||||
|
||||
|
||||
@@ -281,19 +281,19 @@ fun <T : Any> T?.toList(): List<T> = if (this != null) listOf(this) else listOf(
|
||||
fun <T : Any> T?.toSet(): Set<T> = if (this != null) setOf(this) else setOf()
|
||||
|
||||
enum class SmartCompletionItemPriority {
|
||||
IT
|
||||
TRUE
|
||||
FALSE
|
||||
THIS
|
||||
DEFAULT
|
||||
NULLABLE
|
||||
INSTANTIATION
|
||||
STATIC_MEMBER
|
||||
ANONYMOUS_OBJECT
|
||||
LAMBDA_NO_PARAMS
|
||||
LAMBDA
|
||||
FUNCTION_REFERENCE
|
||||
NULL
|
||||
IT,
|
||||
TRUE,
|
||||
FALSE,
|
||||
THIS,
|
||||
DEFAULT,
|
||||
NULLABLE,
|
||||
INSTANTIATION,
|
||||
STATIC_MEMBER,
|
||||
ANONYMOUS_OBJECT,
|
||||
LAMBDA_NO_PARAMS,
|
||||
LAMBDA,
|
||||
FUNCTION_REFERENCE,
|
||||
NULL,
|
||||
INHERITOR_INSTANTIATION
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.kotlin.idea.test.ProjectDescriptorWithStdlibSources
|
||||
import org.jetbrains.kotlin.psi.JetFile
|
||||
|
||||
public enum class ModuleKind {
|
||||
KOTLIN_JVM_WITH_STDLIB_SOURCES
|
||||
KOTLIN_JVM_WITH_STDLIB_SOURCES,
|
||||
KOTLIN_JAVASCRIPT
|
||||
}
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ public class JetAddImportAction(
|
||||
private val module = ModuleUtilCore.findModuleForPsiElement(element)
|
||||
|
||||
private enum class Priority {
|
||||
MODULE
|
||||
PROJECT
|
||||
MODULE,
|
||||
PROJECT,
|
||||
OTHER
|
||||
}
|
||||
|
||||
|
||||
@@ -61,11 +61,11 @@ public class KotlinReferenceData(
|
||||
) : Cloneable, Serializable {
|
||||
|
||||
public enum class Kind {
|
||||
CLASS
|
||||
PACKAGE
|
||||
NON_EXTENSION_CALLABLE
|
||||
EXTENSION_FUNCTION
|
||||
EXTENSION_PROPERTY
|
||||
CLASS,
|
||||
PACKAGE,
|
||||
NON_EXTENSION_CALLABLE,
|
||||
EXTENSION_FUNCTION,
|
||||
EXTENSION_PROPERTY;
|
||||
|
||||
companion object {
|
||||
public fun fromDescriptor(descriptor: DeclarationDescriptor): KotlinReferenceData.Kind? {
|
||||
|
||||
@@ -76,8 +76,8 @@ public class J2kPostProcessor(private val formatCode: Boolean) : PostProcessor {
|
||||
}
|
||||
|
||||
private enum class RangeFilterResult {
|
||||
SKIP
|
||||
GO_INSIDE
|
||||
SKIP,
|
||||
GO_INSIDE,
|
||||
PROCESS
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -119,9 +119,9 @@ class ParameterInfo(
|
||||
)
|
||||
|
||||
enum class CallableKind {
|
||||
FUNCTION
|
||||
CLASS_WITH_PRIMARY_CONSTRUCTOR
|
||||
SECONDARY_CONSTRUCTOR
|
||||
FUNCTION,
|
||||
CLASS_WITH_PRIMARY_CONSTRUCTOR,
|
||||
SECONDARY_CONSTRUCTOR,
|
||||
PROPERTY
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -40,12 +40,12 @@ import java.util.Collections
|
||||
import java.util.HashMap
|
||||
|
||||
enum class ClassKind(val keyword: String, val description: String) {
|
||||
PLAIN_CLASS: ClassKind("class", "class")
|
||||
ENUM_CLASS: ClassKind("enum class", "enum")
|
||||
ENUM_ENTRY: ClassKind("", "enum constant")
|
||||
ANNOTATION_CLASS: ClassKind("annotation class", "annotation")
|
||||
TRAIT: ClassKind("interface", "interface")
|
||||
OBJECT: ClassKind("object", "object")
|
||||
PLAIN_CLASS("class", "class"),
|
||||
ENUM_CLASS("enum class", "enum"),
|
||||
ENUM_ENTRY("", "enum constant"),
|
||||
ANNOTATION_CLASS("annotation class", "annotation"),
|
||||
TRAIT("interface", "interface"),
|
||||
OBJECT("object", "object")
|
||||
}
|
||||
|
||||
public class ClassInfo(
|
||||
|
||||
+3
-3
@@ -27,9 +27,9 @@ import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
||||
|
||||
public trait JetMethodDescriptor : MethodDescriptor<JetParameterInfo, Visibility> {
|
||||
enum class Kind(val isConstructor: Boolean) {
|
||||
FUNCTION: Kind(false)
|
||||
PRIMARY_CONSTRUCTOR: Kind(true)
|
||||
SECONDARY_CONSTRUCTOR: Kind(true)
|
||||
FUNCTION(false),
|
||||
PRIMARY_CONSTRUCTOR(true),
|
||||
SECONDARY_CONSTRUCTOR(true)
|
||||
}
|
||||
|
||||
val kind: Kind get() {
|
||||
|
||||
@@ -20,9 +20,9 @@ import com.intellij.lang.ASTNode
|
||||
import org.jetbrains.kotlin.lexer.JetTokens
|
||||
|
||||
public enum class JetValVar(val name: String) {
|
||||
None: JetValVar("none")
|
||||
Val: JetValVar("val")
|
||||
Var: JetValVar("var")
|
||||
None("none"),
|
||||
Val("val"),
|
||||
Var("var");
|
||||
|
||||
override fun toString(): String = name
|
||||
}
|
||||
|
||||
+22
-22
@@ -310,17 +310,17 @@ data class ExtractableCodeDescriptor(
|
||||
}
|
||||
|
||||
enum class ExtractionTarget(val name: String) {
|
||||
FUNCTION : ExtractionTarget("function") {
|
||||
FUNCTION("function") {
|
||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor) = true
|
||||
}
|
||||
},
|
||||
|
||||
FAKE_LAMBDALIKE_FUNCTION : ExtractionTarget("lambda parameter") {
|
||||
FAKE_LAMBDALIKE_FUNCTION("lambda parameter") {
|
||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
||||
return checkSimpleControlFlow(descriptor) || descriptor.controlFlow.outputValues.isEmpty()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
PROPERTY_WITH_INITIALIZER : ExtractionTarget("property with initializer") {
|
||||
PROPERTY_WITH_INITIALIZER("property with initializer") {
|
||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
||||
return checkSignatureAndParent(descriptor)
|
||||
&& checkSimpleControlFlow(descriptor)
|
||||
@@ -328,22 +328,22 @@ enum class ExtractionTarget(val name: String) {
|
||||
&& checkNotTrait(descriptor)
|
||||
&& descriptor.receiverParameter == null
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
PROPERTY_WITH_GETTER : ExtractionTarget("property with getter") {
|
||||
PROPERTY_WITH_GETTER("property with getter") {
|
||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
||||
return checkSignatureAndParent(descriptor)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
LAZY_PROPERTY : ExtractionTarget("lazy property") {
|
||||
LAZY_PROPERTY("lazy property") {
|
||||
override fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean {
|
||||
return checkSignatureAndParent(descriptor)
|
||||
&& checkSimpleControlFlow(descriptor)
|
||||
&& checkNotTrait(descriptor)
|
||||
&& descriptor.receiverParameter == null
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
abstract fun isAvailable(descriptor: ExtractableCodeDescriptor): Boolean
|
||||
|
||||
@@ -407,22 +407,22 @@ class AnalysisResult (
|
||||
val messages: List<ErrorMessage>
|
||||
) {
|
||||
enum class Status {
|
||||
SUCCESS
|
||||
NON_CRITICAL_ERROR
|
||||
SUCCESS,
|
||||
NON_CRITICAL_ERROR,
|
||||
CRITICAL_ERROR
|
||||
}
|
||||
|
||||
enum class ErrorMessage {
|
||||
NO_EXPRESSION
|
||||
NO_CONTAINER
|
||||
SUPER_CALL
|
||||
DENOTABLE_TYPES
|
||||
ERROR_TYPES
|
||||
MULTIPLE_OUTPUT
|
||||
OUTPUT_AND_EXIT_POINT
|
||||
MULTIPLE_EXIT_POINTS
|
||||
DECLARATIONS_ARE_USED_OUTSIDE
|
||||
DECLARATIONS_OUT_OF_SCOPE
|
||||
NO_EXPRESSION,
|
||||
NO_CONTAINER,
|
||||
SUPER_CALL,
|
||||
DENOTABLE_TYPES,
|
||||
ERROR_TYPES,
|
||||
MULTIPLE_OUTPUT,
|
||||
OUTPUT_AND_EXIT_POINT,
|
||||
MULTIPLE_EXIT_POINTS,
|
||||
DECLARATIONS_ARE_USED_OUTSIDE,
|
||||
DECLARATIONS_OUT_OF_SCOPE;
|
||||
|
||||
var additionalInfo: List<String>? = null
|
||||
|
||||
|
||||
+4
-4
@@ -91,21 +91,21 @@ public class KotlinInplaceParameterIntroducer(
|
||||
}
|
||||
|
||||
enum class PreviewDecorator {
|
||||
FOR_ADD: PreviewDecorator() {
|
||||
FOR_ADD() {
|
||||
override val textAttributes: TextAttributes = with(TextAttributes()) {
|
||||
setEffectType(EffectType.ROUNDED_BOX)
|
||||
setEffectColor(JBColor.RED)
|
||||
this
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
FOR_REMOVAL: PreviewDecorator() {
|
||||
FOR_REMOVAL() {
|
||||
override val textAttributes: TextAttributes = with(TextAttributes()) {
|
||||
setEffectType(EffectType.STRIKEOUT)
|
||||
setEffectColor(Color.BLACK)
|
||||
this
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
protected abstract val textAttributes: TextAttributes
|
||||
|
||||
|
||||
+2
-2
@@ -91,8 +91,8 @@ public class RenameKotlinPropertyProcessor : RenamePsiElementProcessor() {
|
||||
}
|
||||
|
||||
private enum class UsageKind {
|
||||
SIMPLE_PROPERTY_USAGE
|
||||
GETTER_USAGE
|
||||
SIMPLE_PROPERTY_USAGE,
|
||||
GETTER_USAGE,
|
||||
SETTER_USAGE
|
||||
}
|
||||
|
||||
|
||||
@@ -94,11 +94,11 @@ public trait UnificationResult {
|
||||
public enum class Status {
|
||||
MATCHED {
|
||||
override fun and(other: Status): Status = other
|
||||
}
|
||||
},
|
||||
|
||||
UNMATCHED {
|
||||
override fun and(other: Status): Status = this
|
||||
}
|
||||
};
|
||||
|
||||
public abstract fun and(other: Status): Status
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ enum class MoveAction {
|
||||
|
||||
MoveMembersProcessor(elementAtCaret.getProject(), options).run()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
MOVE_TOP_LEVEL_CLASSES {
|
||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||
@@ -152,7 +152,7 @@ enum class MoveAction {
|
||||
/* moveCallback = */ null
|
||||
).run()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
MOVE_PACKAGES {
|
||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||
@@ -169,7 +169,7 @@ enum class MoveAction {
|
||||
/* moveCallback = */ null
|
||||
).run()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
MOVE_TOP_LEVEL_CLASSES_TO_INNER {
|
||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||
@@ -187,7 +187,7 @@ enum class MoveAction {
|
||||
/* moveCallback = */ null
|
||||
).run()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
MOVE_INNER_CLASS {
|
||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||
@@ -207,7 +207,7 @@ enum class MoveAction {
|
||||
JavaPsiFacade.getInstance(project).findPackage(targetPackage)!!.getDirectories()[0]
|
||||
).run()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
MOVE_FILES {
|
||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||
@@ -238,7 +238,7 @@ enum class MoveAction {
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS {
|
||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||
@@ -254,13 +254,13 @@ enum class MoveAction {
|
||||
val options = MoveKotlinTopLevelDeclarationsOptions(listOf(elementToMove), moveTarget)
|
||||
MoveKotlinTopLevelDeclarationsProcessor(mainFile.getProject(), options).run()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
CHANGE_PACKAGE_DIRECTIVE {
|
||||
override fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject) {
|
||||
KotlinChangePackageRefactoring(mainFile as JetFile).run(FqName(config.getString("newPackageName")))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
abstract fun runRefactoring(rootDir: VirtualFile, mainFile: PsiFile, elementAtCaret: PsiElement?, config: JsonObject)
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ import org.junit.Assert
|
||||
import java.io.File
|
||||
|
||||
private enum class RenameType {
|
||||
JAVA_CLASS
|
||||
JAVA_METHOD
|
||||
KOTLIN_CLASS
|
||||
KOTLIN_FUNCTION
|
||||
KOTLIN_PROPERTY
|
||||
JAVA_CLASS,
|
||||
JAVA_METHOD,
|
||||
KOTLIN_CLASS,
|
||||
KOTLIN_FUNCTION,
|
||||
KOTLIN_PROPERTY,
|
||||
KOTLIN_PACKAGE
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class FieldCorrectionInfo(val name: String, val access: Modifier?, val setterAcc
|
||||
}
|
||||
|
||||
enum class AccessorKind {
|
||||
GETTER
|
||||
GETTER,
|
||||
SETTER
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ object DocCommentConverter {
|
||||
getValueElement() ?: getDataElements().firstOrNull { it !is PsiWhiteSpace }
|
||||
|
||||
private class HtmlToMarkdownConverter() : XmlRecursiveElementVisitor() {
|
||||
private enum class ListType { Ordered Unordered; }
|
||||
private enum class ListType { Ordered, Unordered; }
|
||||
data class MarkdownSpan(val prefix: String, val suffix: String) {
|
||||
companion object {
|
||||
val Empty = MarkdownSpan("", "")
|
||||
|
||||
@@ -121,8 +121,8 @@ class ForConverter(
|
||||
) : Statement() {
|
||||
|
||||
public enum class Kind {
|
||||
SIMPLE
|
||||
WITH_BLOCK
|
||||
SIMPLE,
|
||||
WITH_BLOCK,
|
||||
WITH_RUN_BLOCK
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public trait PostProcessor {
|
||||
}
|
||||
|
||||
public enum class ParseContext {
|
||||
TOP_LEVEL
|
||||
TOP_LEVEL,
|
||||
CODE_BLOCK
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.intellij.psi.PsiSuperExpression
|
||||
import org.jetbrains.kotlin.j2k.ast.*
|
||||
|
||||
enum class SpecialMethod(val qualifiedClassName: String?, val methodName: String, val parameterCount: Int?) {
|
||||
OBJECT_EQUALS: SpecialMethod(null, "equals", 1) {
|
||||
OBJECT_EQUALS(null, "equals", 1) {
|
||||
override fun matches(method: PsiMethod)
|
||||
= super.matches(method) && method.getParameterList().getParameters().single().getType().getCanonicalText() == JAVA_LANG_OBJECT
|
||||
|
||||
@@ -32,54 +32,54 @@ enum class SpecialMethod(val qualifiedClassName: String?, val methodName: String
|
||||
if (qualifier == null || qualifier is PsiSuperExpression) return null
|
||||
return BinaryExpression(codeConverter.convertExpression(qualifier), codeConverter.convertExpression(arguments.single()), "==")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
OBJECT_GET_CLASS: SpecialMethod("java.lang.Object", "getClass", 0) {
|
||||
OBJECT_GET_CLASS("java.lang.Object", "getClass", 0) {
|
||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter): Expression {
|
||||
val identifier = Identifier("javaClass", false).assignNoPrototype()
|
||||
return if (qualifier != null) QualifiedExpression(codeConverter.convertExpression(qualifier), identifier) else identifier
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
OBJECTS_EQUALS: SpecialMethod("java.util.Objects", "equals", 2) {
|
||||
OBJECTS_EQUALS("java.util.Objects", "equals", 2) {
|
||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||
= BinaryExpression(codeConverter.convertExpression(arguments[0]), codeConverter.convertExpression(arguments[1]), "==")
|
||||
}
|
||||
},
|
||||
|
||||
COLLECTIONS_EMPTY_LIST: SpecialMethod("java.util.Collections", "emptyList", 0) {
|
||||
COLLECTIONS_EMPTY_LIST("java.util.Collections", "emptyList", 0) {
|
||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||
= MethodCallExpression.build(null, "emptyList", listOf(), typeArgumentsConverted, false)
|
||||
}
|
||||
},
|
||||
|
||||
COLLECTIONS_EMPTY_SET: SpecialMethod("java.util.Collections", "emptySet", 0) {
|
||||
COLLECTIONS_EMPTY_SET("java.util.Collections", "emptySet", 0) {
|
||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||
= MethodCallExpression.build(null, "emptySet", listOf(), typeArgumentsConverted, false)
|
||||
}
|
||||
},
|
||||
|
||||
COLLECTIONS_EMPTY_MAP: SpecialMethod("java.util.Collections", "emptyMap", 0) {
|
||||
COLLECTIONS_EMPTY_MAP("java.util.Collections", "emptyMap", 0) {
|
||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||
= MethodCallExpression.build(null, "emptyMap", listOf(), typeArgumentsConverted, false)
|
||||
}
|
||||
},
|
||||
|
||||
COLLECTIONS_SINGLETON_LIST: SpecialMethod("java.util.Collections", "singletonList", 1) {
|
||||
COLLECTIONS_SINGLETON_LIST("java.util.Collections", "singletonList", 1) {
|
||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||
= MethodCallExpression.build(null, "listOf", listOf(codeConverter.convertExpression(arguments.single())), typeArgumentsConverted, false)
|
||||
}
|
||||
},
|
||||
|
||||
COLLECTIONS_SINGLETON: SpecialMethod("java.util.Collections", "singleton", 1) {
|
||||
COLLECTIONS_SINGLETON("java.util.Collections", "singleton", 1) {
|
||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||
= MethodCallExpression.build(null, "setOf", listOf(codeConverter.convertExpression(arguments.single())), typeArgumentsConverted, false)
|
||||
}
|
||||
},
|
||||
|
||||
SYSTEM_OUT_PRINTLN: SpecialMethod("java.io.PrintStream", "println", null) {
|
||||
SYSTEM_OUT_PRINTLN("java.io.PrintStream", "println", null) {
|
||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||
= convertSystemOutMethodCall(methodName, qualifier, arguments, typeArgumentsConverted, codeConverter)
|
||||
}
|
||||
},
|
||||
|
||||
SYSTEM_OUT_PRINT: SpecialMethod("java.io.PrintStream", "print", null) {
|
||||
SYSTEM_OUT_PRINT("java.io.PrintStream", "print", null) {
|
||||
override fun convertCall(qualifier: PsiExpression?, arguments: Array<PsiExpression>, typeArgumentsConverted: List<Type>, codeConverter: CodeConverter)
|
||||
= convertSystemOutMethodCall(methodName, qualifier, arguments, typeArgumentsConverted, codeConverter)
|
||||
}
|
||||
};
|
||||
|
||||
open fun matches(method: PsiMethod): Boolean {
|
||||
if (method.getName() != methodName) return false
|
||||
|
||||
@@ -20,13 +20,13 @@ import org.jetbrains.kotlin.j2k.*
|
||||
import java.util.HashSet
|
||||
|
||||
enum class Modifier(val name: String) {
|
||||
PUBLIC: Modifier("public")
|
||||
PROTECTED: Modifier("protected")
|
||||
PRIVATE: Modifier("private")
|
||||
ABSTRACT: Modifier("abstract")
|
||||
OPEN: Modifier("open")
|
||||
OVERRIDE: Modifier("override")
|
||||
INNER: Modifier("inner")
|
||||
PUBLIC("public"),
|
||||
PROTECTED("protected"),
|
||||
PRIVATE("private"),
|
||||
ABSTRACT("abstract"),
|
||||
OPEN("open"),
|
||||
OVERRIDE("override"),
|
||||
INNER("inner");
|
||||
|
||||
public fun toKotlin(): String = name
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ class Parameter(val identifier: Identifier,
|
||||
val modifiers: Modifiers,
|
||||
val defaultValue: DeferredElement<Expression>? = null) : Element() {
|
||||
public enum class VarValModifier {
|
||||
None
|
||||
Val
|
||||
None,
|
||||
Val,
|
||||
Var
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ import org.jetbrains.kotlin.j2k.*
|
||||
fun Type.isUnit(): Boolean = this is UnitType
|
||||
|
||||
enum class Nullability {
|
||||
Nullable
|
||||
NotNull
|
||||
Nullable,
|
||||
NotNull,
|
||||
Default
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ fun Nullability.isNullable(settings: ConverterSettings) = when(this) {
|
||||
}
|
||||
|
||||
enum class Mutability {
|
||||
Mutable
|
||||
NonMutable
|
||||
Mutable,
|
||||
NonMutable,
|
||||
Default
|
||||
}
|
||||
|
||||
|
||||
@@ -411,7 +411,7 @@ public class IncrementalCacheImpl(targetDataRoot: File) : StorageOwner, Incremen
|
||||
}
|
||||
|
||||
private enum class Kind {
|
||||
INT FLOAT LONG DOUBLE STRING
|
||||
INT, FLOAT, LONG, DOUBLE, STRING
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,10 +588,10 @@ public class IncrementalCacheImpl(targetDataRoot: File) : StorageOwner, Incremen
|
||||
}
|
||||
|
||||
enum class RecompilationDecision {
|
||||
DO_NOTHING
|
||||
RECOMPILE_OTHER_KOTLIN_IN_CHUNK
|
||||
RECOMPILE_OTHER_IN_CHUNK_AND_DEPENDANTS
|
||||
RECOMPILE_ALL_IN_CHUNK_AND_DEPENDANTS
|
||||
DO_NOTHING,
|
||||
RECOMPILE_OTHER_KOTLIN_IN_CHUNK,
|
||||
RECOMPILE_OTHER_IN_CHUNK_AND_DEPENDANTS,
|
||||
RECOMPILE_ALL_IN_CHUNK_AND_DEPENDANTS;
|
||||
|
||||
fun merge(other: RecompilationDecision): RecompilationDecision {
|
||||
return if (other.ordinal() > this.ordinal()) other else this
|
||||
|
||||
+1
-1
@@ -37,6 +37,6 @@ public var JsParameter.hasDefaultValue: Boolean by MetadataProperty(default = fa
|
||||
public var JsInvocation.typeCheck: TypeCheck? by MetadataProperty(default = null)
|
||||
|
||||
public enum class TypeCheck {
|
||||
TYPEOF
|
||||
TYPEOF,
|
||||
INSTANCEOF
|
||||
}
|
||||
@@ -20,11 +20,11 @@ import kotlin.properties.Delegates
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
|
||||
public enum class PredefinedAnnotation(fqName: String) {
|
||||
LIBRARY : PredefinedAnnotation("kotlin.js.library")
|
||||
NATIVE : PredefinedAnnotation("kotlin.js.native")
|
||||
NATIVE_INVOKE : PredefinedAnnotation("kotlin.js.nativeInvoke")
|
||||
NATIVE_GETTER : PredefinedAnnotation("kotlin.js.nativeGetter")
|
||||
NATIVE_SETTER : PredefinedAnnotation("kotlin.js.nativeSetter")
|
||||
LIBRARY("kotlin.js.library"),
|
||||
NATIVE("kotlin.js.native"),
|
||||
NATIVE_INVOKE("kotlin.js.nativeInvoke"),
|
||||
NATIVE_GETTER("kotlin.js.nativeGetter"),
|
||||
NATIVE_SETTER("kotlin.js.nativeSetter");
|
||||
|
||||
public val fqName: FqName = FqName(fqName)
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ public class CallArgumentTranslator private (
|
||||
}
|
||||
|
||||
private enum class ArgumentsKind {
|
||||
HAS_EMPTY_EXPRESSION_ARGUMENT
|
||||
HAS_EMPTY_EXPRESSION_ARGUMENT,
|
||||
HAS_NOT_EMPTY_EXPRESSION_ARGUMENT
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
package org.jetbrains.kotlin.js.translate.utils
|
||||
|
||||
enum class InlineAnnotation(val fqName: String) {
|
||||
INLINE : InlineAnnotation("kotlin.inline")
|
||||
NO_INLINE : InlineAnnotation("kotlin.noinline")
|
||||
INLINE("kotlin.inline"),
|
||||
NO_INLINE("kotlin.noinline")
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ import java.util.NoSuchElementException
|
||||
import java.lang.UnsupportedOperationException
|
||||
|
||||
private enum class State {
|
||||
Ready
|
||||
NotReady
|
||||
Done
|
||||
Ready,
|
||||
NotReady,
|
||||
Done,
|
||||
Failed
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.Stack
|
||||
*/
|
||||
public enum class FileWalkDirection {
|
||||
/** Depth-first search, directory is visited BEFORE its files */
|
||||
TOP_DOWN
|
||||
TOP_DOWN,
|
||||
/** Depth-first search, directory is visited AFTER its files */
|
||||
BOTTOM_UP
|
||||
// Do we want also breadth-first search?
|
||||
|
||||
@@ -235,7 +235,7 @@ public fun File.copyTo(dst: File, overwrite: Boolean = false, bufferSize: Int =
|
||||
*/
|
||||
public enum class OnErrorAction {
|
||||
/** Skip this file and go to the next. */
|
||||
SKIP
|
||||
SKIP,
|
||||
|
||||
/** Terminate the evaluation of the function. */
|
||||
TERMINATE
|
||||
|
||||
@@ -9,152 +9,152 @@ public enum class CharCategory(public val value: Int, public val code: String) {
|
||||
/**
|
||||
* General category "Cn" in the Unicode specification.
|
||||
*/
|
||||
UNASSIGNED: CharCategory(Character.UNASSIGNED.toInt(), "Cn")
|
||||
UNASSIGNED(Character.UNASSIGNED.toInt(), "Cn"),
|
||||
|
||||
/**
|
||||
* General category "Lu" in the Unicode specification.
|
||||
*/
|
||||
UPPERCASE_LETTER: CharCategory(Character.UPPERCASE_LETTER.toInt(), "Lu")
|
||||
UPPERCASE_LETTER(Character.UPPERCASE_LETTER.toInt(), "Lu"),
|
||||
|
||||
/**
|
||||
* General category "Ll" in the Unicode specification.
|
||||
*/
|
||||
LOWERCASE_LETTER: CharCategory(Character.LOWERCASE_LETTER.toInt(), "Ll")
|
||||
LOWERCASE_LETTER(Character.LOWERCASE_LETTER.toInt(), "Ll"),
|
||||
|
||||
/**
|
||||
* General category "Lt" in the Unicode specification.
|
||||
*/
|
||||
TITLECASE_LETTER: CharCategory(Character.TITLECASE_LETTER.toInt(), "Lt")
|
||||
TITLECASE_LETTER(Character.TITLECASE_LETTER.toInt(), "Lt"),
|
||||
|
||||
/**
|
||||
* General category "Lm" in the Unicode specification.
|
||||
*/
|
||||
MODIFIER_LETTER: CharCategory(Character.MODIFIER_LETTER.toInt(), "Lm")
|
||||
MODIFIER_LETTER(Character.MODIFIER_LETTER.toInt(), "Lm"),
|
||||
|
||||
/**
|
||||
* General category "Lo" in the Unicode specification.
|
||||
*/
|
||||
OTHER_LETTER: CharCategory(Character.OTHER_LETTER.toInt(), "Lo")
|
||||
OTHER_LETTER(Character.OTHER_LETTER.toInt(), "Lo"),
|
||||
|
||||
/**
|
||||
* General category "Mn" in the Unicode specification.
|
||||
*/
|
||||
NON_SPACING_MARK: CharCategory(Character.NON_SPACING_MARK.toInt(), "Mn")
|
||||
NON_SPACING_MARK(Character.NON_SPACING_MARK.toInt(), "Mn"),
|
||||
|
||||
/**
|
||||
* General category "Me" in the Unicode specification.
|
||||
*/
|
||||
ENCLOSING_MARK: CharCategory(Character.ENCLOSING_MARK.toInt(), "Me")
|
||||
ENCLOSING_MARK(Character.ENCLOSING_MARK.toInt(), "Me"),
|
||||
|
||||
/**
|
||||
* General category "Mc" in the Unicode specification.
|
||||
*/
|
||||
COMBINING_SPACING_MARK: CharCategory(Character.COMBINING_SPACING_MARK.toInt(), "Mc")
|
||||
COMBINING_SPACING_MARK(Character.COMBINING_SPACING_MARK.toInt(), "Mc"),
|
||||
|
||||
/**
|
||||
* General category "Nd" in the Unicode specification.
|
||||
*/
|
||||
DECIMAL_DIGIT_NUMBER: CharCategory(Character.DECIMAL_DIGIT_NUMBER.toInt(), "Nd")
|
||||
DECIMAL_DIGIT_NUMBER(Character.DECIMAL_DIGIT_NUMBER.toInt(), "Nd"),
|
||||
|
||||
/**
|
||||
* General category "Nl" in the Unicode specification.
|
||||
*/
|
||||
LETTER_NUMBER: CharCategory(Character.LETTER_NUMBER.toInt(), "Nl")
|
||||
LETTER_NUMBER(Character.LETTER_NUMBER.toInt(), "Nl"),
|
||||
|
||||
/**
|
||||
* General category "No" in the Unicode specification.
|
||||
*/
|
||||
OTHER_NUMBER: CharCategory(Character.OTHER_NUMBER.toInt(), "No")
|
||||
OTHER_NUMBER(Character.OTHER_NUMBER.toInt(), "No"),
|
||||
|
||||
/**
|
||||
* General category "Zs" in the Unicode specification.
|
||||
*/
|
||||
SPACE_SEPARATOR: CharCategory(Character.SPACE_SEPARATOR.toInt(), "Zs")
|
||||
SPACE_SEPARATOR(Character.SPACE_SEPARATOR.toInt(), "Zs"),
|
||||
|
||||
/**
|
||||
* General category "Zl" in the Unicode specification.
|
||||
*/
|
||||
LINE_SEPARATOR: CharCategory(Character.LINE_SEPARATOR.toInt(), "Zl")
|
||||
LINE_SEPARATOR(Character.LINE_SEPARATOR.toInt(), "Zl"),
|
||||
|
||||
/**
|
||||
* General category "Zp" in the Unicode specification.
|
||||
*/
|
||||
PARAGRAPH_SEPARATOR: CharCategory(Character.PARAGRAPH_SEPARATOR.toInt(), "Zp")
|
||||
PARAGRAPH_SEPARATOR(Character.PARAGRAPH_SEPARATOR.toInt(), "Zp"),
|
||||
|
||||
/**
|
||||
* General category "Cc" in the Unicode specification.
|
||||
*/
|
||||
CONTROL: CharCategory(Character.CONTROL.toInt(), "Cc")
|
||||
CONTROL(Character.CONTROL.toInt(), "Cc"),
|
||||
|
||||
/**
|
||||
* General category "Cf" in the Unicode specification.
|
||||
*/
|
||||
FORMAT: CharCategory(Character.FORMAT.toInt(), "Cf")
|
||||
FORMAT(Character.FORMAT.toInt(), "Cf"),
|
||||
|
||||
/**
|
||||
* General category "Co" in the Unicode specification.
|
||||
*/
|
||||
PRIVATE_USE: CharCategory(Character.PRIVATE_USE.toInt(), "Co")
|
||||
PRIVATE_USE(Character.PRIVATE_USE.toInt(), "Co"),
|
||||
|
||||
/**
|
||||
* General category "Cs" in the Unicode specification.
|
||||
*/
|
||||
SURROGATE: CharCategory(Character.SURROGATE.toInt(), "Cs")
|
||||
SURROGATE(Character.SURROGATE.toInt(), "Cs"),
|
||||
|
||||
/**
|
||||
* General category "Pd" in the Unicode specification.
|
||||
*/
|
||||
DASH_PUNCTUATION: CharCategory(Character.DASH_PUNCTUATION.toInt(), "Pd")
|
||||
DASH_PUNCTUATION(Character.DASH_PUNCTUATION.toInt(), "Pd"),
|
||||
|
||||
/**
|
||||
* General category "Ps" in the Unicode specification.
|
||||
*/
|
||||
START_PUNCTUATION: CharCategory(Character.START_PUNCTUATION.toInt(), "Ps")
|
||||
START_PUNCTUATION(Character.START_PUNCTUATION.toInt(), "Ps"),
|
||||
|
||||
/**
|
||||
* General category "Pe" in the Unicode specification.
|
||||
*/
|
||||
END_PUNCTUATION: CharCategory(Character.END_PUNCTUATION.toInt(), "Pe")
|
||||
END_PUNCTUATION(Character.END_PUNCTUATION.toInt(), "Pe"),
|
||||
|
||||
/**
|
||||
* General category "Pc" in the Unicode specification.
|
||||
*/
|
||||
CONNECTOR_PUNCTUATION: CharCategory(Character.CONNECTOR_PUNCTUATION.toInt(), "Pc")
|
||||
CONNECTOR_PUNCTUATION(Character.CONNECTOR_PUNCTUATION.toInt(), "Pc"),
|
||||
|
||||
/**
|
||||
* General category "Po" in the Unicode specification.
|
||||
*/
|
||||
OTHER_PUNCTUATION: CharCategory(Character.OTHER_PUNCTUATION.toInt(), "Po")
|
||||
OTHER_PUNCTUATION(Character.OTHER_PUNCTUATION.toInt(), "Po"),
|
||||
|
||||
/**
|
||||
* General category "Sm" in the Unicode specification.
|
||||
*/
|
||||
MATH_SYMBOL: CharCategory(Character.MATH_SYMBOL.toInt(), "Sm")
|
||||
MATH_SYMBOL(Character.MATH_SYMBOL.toInt(), "Sm"),
|
||||
|
||||
/**
|
||||
* General category "Sc" in the Unicode specification.
|
||||
*/
|
||||
CURRENCY_SYMBOL: CharCategory(Character.CURRENCY_SYMBOL.toInt(), "Sc")
|
||||
CURRENCY_SYMBOL(Character.CURRENCY_SYMBOL.toInt(), "Sc"),
|
||||
|
||||
/**
|
||||
* General category "Sk" in the Unicode specification.
|
||||
*/
|
||||
MODIFIER_SYMBOL: CharCategory(Character.MODIFIER_SYMBOL.toInt(), "Sk")
|
||||
MODIFIER_SYMBOL(Character.MODIFIER_SYMBOL.toInt(), "Sk"),
|
||||
|
||||
/**
|
||||
* General category "So" in the Unicode specification.
|
||||
*/
|
||||
OTHER_SYMBOL: CharCategory(Character.OTHER_SYMBOL.toInt(), "So")
|
||||
OTHER_SYMBOL(Character.OTHER_SYMBOL.toInt(), "So"),
|
||||
|
||||
/**
|
||||
* General category "Pi" in the Unicode specification.
|
||||
*/
|
||||
INITIAL_QUOTE_PUNCTUATION: CharCategory(Character.INITIAL_QUOTE_PUNCTUATION.toInt(), "Pi")
|
||||
INITIAL_QUOTE_PUNCTUATION(Character.INITIAL_QUOTE_PUNCTUATION.toInt(), "Pi"),
|
||||
|
||||
/**
|
||||
* General category "Pf" in the Unicode specification.
|
||||
*/
|
||||
FINAL_QUOTE_PUNCTUATION: CharCategory(Character.FINAL_QUOTE_PUNCTUATION.toInt(), "Pf")
|
||||
FINAL_QUOTE_PUNCTUATION(Character.FINAL_QUOTE_PUNCTUATION.toInt(), "Pf");
|
||||
|
||||
|
||||
public companion object {
|
||||
|
||||
@@ -13,102 +13,102 @@ public enum class CharDirectionality(public val value: Int) {
|
||||
* Undefined bidirectional character type. Undefined `char`
|
||||
* values have undefined directionality in the Unicode specification.
|
||||
*/
|
||||
UNDEFINED: CharDirectionality(Character.DIRECTIONALITY_UNDEFINED.toInt())
|
||||
UNDEFINED(Character.DIRECTIONALITY_UNDEFINED.toInt()),
|
||||
|
||||
/**
|
||||
* Strong bidirectional character type "L" in the Unicode specification.
|
||||
*/
|
||||
LEFT_TO_RIGHT: CharDirectionality(Character.DIRECTIONALITY_LEFT_TO_RIGHT.toInt())
|
||||
LEFT_TO_RIGHT(Character.DIRECTIONALITY_LEFT_TO_RIGHT.toInt()),
|
||||
|
||||
/**
|
||||
* Strong bidirectional character type "R" in the Unicode specification.
|
||||
*/
|
||||
RIGHT_TO_LEFT: CharDirectionality(Character.DIRECTIONALITY_RIGHT_TO_LEFT.toInt())
|
||||
RIGHT_TO_LEFT(Character.DIRECTIONALITY_RIGHT_TO_LEFT.toInt()),
|
||||
|
||||
/**
|
||||
* Strong bidirectional character type "AL" in the Unicode specification.
|
||||
*/
|
||||
RIGHT_TO_LEFT_ARABIC: CharDirectionality(Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC.toInt())
|
||||
RIGHT_TO_LEFT_ARABIC(Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC.toInt()),
|
||||
|
||||
/**
|
||||
* Weak bidirectional character type "EN" in the Unicode specification.
|
||||
*/
|
||||
EUROPEAN_NUMBER: CharDirectionality(Character.DIRECTIONALITY_EUROPEAN_NUMBER.toInt())
|
||||
EUROPEAN_NUMBER(Character.DIRECTIONALITY_EUROPEAN_NUMBER.toInt()),
|
||||
|
||||
/**
|
||||
* Weak bidirectional character type "ES" in the Unicode specification.
|
||||
*/
|
||||
EUROPEAN_NUMBER_SEPARATOR: CharDirectionality(Character.DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR.toInt())
|
||||
EUROPEAN_NUMBER_SEPARATOR(Character.DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR.toInt()),
|
||||
|
||||
/**
|
||||
* Weak bidirectional character type "ET" in the Unicode specification.
|
||||
*/
|
||||
EUROPEAN_NUMBER_TERMINATOR: CharDirectionality(Character.DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR.toInt())
|
||||
EUROPEAN_NUMBER_TERMINATOR(Character.DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR.toInt()),
|
||||
|
||||
/**
|
||||
* Weak bidirectional character type "AN" in the Unicode specification.
|
||||
*/
|
||||
ARABIC_NUMBER: CharDirectionality(Character.DIRECTIONALITY_ARABIC_NUMBER.toInt())
|
||||
ARABIC_NUMBER(Character.DIRECTIONALITY_ARABIC_NUMBER.toInt()),
|
||||
|
||||
/**
|
||||
* Weak bidirectional character type "CS" in the Unicode specification.
|
||||
*/
|
||||
COMMON_NUMBER_SEPARATOR: CharDirectionality(Character.DIRECTIONALITY_COMMON_NUMBER_SEPARATOR.toInt())
|
||||
COMMON_NUMBER_SEPARATOR(Character.DIRECTIONALITY_COMMON_NUMBER_SEPARATOR.toInt()),
|
||||
|
||||
/**
|
||||
* Weak bidirectional character type "NSM" in the Unicode specification.
|
||||
*/
|
||||
NONSPACING_MARK: CharDirectionality(Character.DIRECTIONALITY_NONSPACING_MARK.toInt())
|
||||
NONSPACING_MARK(Character.DIRECTIONALITY_NONSPACING_MARK.toInt()),
|
||||
|
||||
/**
|
||||
* Weak bidirectional character type "BN" in the Unicode specification.
|
||||
*/
|
||||
BOUNDARY_NEUTRAL: CharDirectionality(Character.DIRECTIONALITY_BOUNDARY_NEUTRAL.toInt())
|
||||
BOUNDARY_NEUTRAL(Character.DIRECTIONALITY_BOUNDARY_NEUTRAL.toInt()),
|
||||
|
||||
/**
|
||||
* Neutral bidirectional character type "B" in the Unicode specification.
|
||||
*/
|
||||
PARAGRAPH_SEPARATOR: CharDirectionality(Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR.toInt())
|
||||
PARAGRAPH_SEPARATOR(Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR.toInt()),
|
||||
|
||||
/**
|
||||
* Neutral bidirectional character type "S" in the Unicode specification.
|
||||
*/
|
||||
SEGMENT_SEPARATOR: CharDirectionality(Character.DIRECTIONALITY_SEGMENT_SEPARATOR.toInt())
|
||||
SEGMENT_SEPARATOR(Character.DIRECTIONALITY_SEGMENT_SEPARATOR.toInt()),
|
||||
|
||||
/**
|
||||
* Neutral bidirectional character type "WS" in the Unicode specification.
|
||||
*/
|
||||
WHITESPACE: CharDirectionality(Character.DIRECTIONALITY_WHITESPACE.toInt())
|
||||
WHITESPACE(Character.DIRECTIONALITY_WHITESPACE.toInt()),
|
||||
|
||||
/**
|
||||
* Neutral bidirectional character type "ON" in the Unicode specification.
|
||||
*/
|
||||
OTHER_NEUTRALS: CharDirectionality(Character.DIRECTIONALITY_OTHER_NEUTRALS.toInt())
|
||||
OTHER_NEUTRALS(Character.DIRECTIONALITY_OTHER_NEUTRALS.toInt()),
|
||||
|
||||
/**
|
||||
* Strong bidirectional character type "LRE" in the Unicode specification.
|
||||
*/
|
||||
LEFT_TO_RIGHT_EMBEDDING: CharDirectionality(Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING.toInt())
|
||||
LEFT_TO_RIGHT_EMBEDDING(Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING.toInt()),
|
||||
|
||||
/**
|
||||
* Strong bidirectional character type "LRO" in the Unicode specification.
|
||||
*/
|
||||
LEFT_TO_RIGHT_OVERRIDE: CharDirectionality(Character.DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE.toInt())
|
||||
LEFT_TO_RIGHT_OVERRIDE(Character.DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE.toInt()),
|
||||
|
||||
/**
|
||||
* Strong bidirectional character type "RLE" in the Unicode specification.
|
||||
*/
|
||||
RIGHT_TO_LEFT_EMBEDDING: CharDirectionality(Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING.toInt())
|
||||
RIGHT_TO_LEFT_EMBEDDING(Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING.toInt()),
|
||||
|
||||
/**
|
||||
* Strong bidirectional character type "RLO" in the Unicode specification.
|
||||
*/
|
||||
RIGHT_TO_LEFT_OVERRIDE: CharDirectionality(Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE.toInt())
|
||||
RIGHT_TO_LEFT_OVERRIDE(Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE.toInt()),
|
||||
|
||||
/**
|
||||
* Weak bidirectional character type "PDF" in the Unicode specification.
|
||||
*/
|
||||
POP_DIRECTIONAL_FORMAT: CharDirectionality(Character.DIRECTIONALITY_POP_DIRECTIONAL_FORMAT.toInt())
|
||||
POP_DIRECTIONAL_FORMAT(Character.DIRECTIONALITY_POP_DIRECTIONAL_FORMAT.toInt());
|
||||
|
||||
|
||||
public companion object {
|
||||
|
||||
@@ -35,13 +35,13 @@ public enum class RegexOption(override val value: Int, override val mask: Int =
|
||||
// common
|
||||
|
||||
/** Enables case-insensitive matching. Case comparison is Unicode-aware. */
|
||||
IGNORE_CASE : RegexOption(Pattern.CASE_INSENSITIVE)
|
||||
IGNORE_CASE(Pattern.CASE_INSENSITIVE),
|
||||
|
||||
/** Enables multiline mode.
|
||||
*
|
||||
* In multiline mode the expressions `^` and `$` match just after or just before,
|
||||
* respectively, a line terminator or the end of the input sequence. */
|
||||
MULTILINE : RegexOption(Pattern.MULTILINE)
|
||||
MULTILINE(Pattern.MULTILINE),
|
||||
|
||||
//jvm-specific
|
||||
|
||||
@@ -49,27 +49,27 @@ public enum class RegexOption(override val value: Int, override val mask: Int =
|
||||
*
|
||||
* Metacharacters or escape sequences in the input sequence will be given no special meaning.
|
||||
*/
|
||||
LITERAL : RegexOption(Pattern.LITERAL)
|
||||
LITERAL(Pattern.LITERAL),
|
||||
|
||||
// // Unicode case is enabled by default with the IGNORE_CASE
|
||||
// /** Enables Unicode-aware case folding. */
|
||||
// UNICODE_CASE: RegexOption(Pattern.UNICODE_CASE)
|
||||
// UNICODE_CASE(Pattern.UNICODE_CASE)
|
||||
|
||||
/** Enables Unix lines mode.
|
||||
* In this mode, only the `'\n'` is recognized as a line terminator.
|
||||
*/
|
||||
UNIX_LINES: RegexOption(Pattern.UNIX_LINES) // TODO: Remove this
|
||||
UNIX_LINES(Pattern.UNIX_LINES), // TODO: Remove this
|
||||
|
||||
/** Permits whitespace and comments in pattern. */
|
||||
COMMENTS: RegexOption(Pattern.COMMENTS)
|
||||
COMMENTS(Pattern.COMMENTS),
|
||||
|
||||
/** Enables the mode, when the expression `.` matches any character,
|
||||
* including a line terminator.
|
||||
*/
|
||||
DOT_MATCHES_ALL: RegexOption(Pattern.DOTALL)
|
||||
DOT_MATCHES_ALL(Pattern.DOTALL),
|
||||
|
||||
/** Enables equivalence by canonical decomposition. */
|
||||
CANON_EQ: RegexOption(Pattern.CANON_EQ)
|
||||
CANON_EQ(Pattern.CANON_EQ)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ data class Constant(val name: String, val type: String, val value: String?)
|
||||
fun Attribute.formatFunctionTypePart() = if (vararg) "vararg $type" else type
|
||||
|
||||
enum class DefinitionKind {
|
||||
INTERFACE
|
||||
TYPEDEF
|
||||
EXTENSION_INTERFACE
|
||||
ENUM
|
||||
INTERFACE,
|
||||
TYPEDEF,
|
||||
EXTENSION_INTERFACE,
|
||||
ENUM,
|
||||
DICTIONARY
|
||||
}
|
||||
|
||||
|
||||
@@ -43,13 +43,13 @@ val GenerateAttribute.signature: String
|
||||
fun GenerateAttribute.dynamicIfUnknownType(allTypes : Set<String>, standardTypes : Set<String> = standardTypes()) = copy(type = type.dynamicIfUnknownType(allTypes, standardTypes))
|
||||
|
||||
enum class NativeGetterOrSetter {
|
||||
NONE
|
||||
GETTER
|
||||
NONE,
|
||||
GETTER,
|
||||
SETTER
|
||||
}
|
||||
|
||||
enum class GenerateDefinitionKind {
|
||||
TRAIT
|
||||
TRAIT,
|
||||
CLASS
|
||||
}
|
||||
|
||||
|
||||
@@ -7,31 +7,31 @@ import java.util.*
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
enum class Family {
|
||||
Sequences
|
||||
Iterables
|
||||
Collections
|
||||
Lists
|
||||
Maps
|
||||
ArraysOfObjects
|
||||
ArraysOfPrimitives
|
||||
Strings
|
||||
RangesOfPrimitives
|
||||
ProgressionsOfPrimitives
|
||||
Primitives
|
||||
Generic
|
||||
Sequences,
|
||||
Iterables,
|
||||
Collections,
|
||||
Lists,
|
||||
Maps,
|
||||
ArraysOfObjects,
|
||||
ArraysOfPrimitives,
|
||||
Strings,
|
||||
RangesOfPrimitives,
|
||||
ProgressionsOfPrimitives,
|
||||
Primitives,
|
||||
Generic;
|
||||
|
||||
val isPrimitiveSpecialization: Boolean by Delegates.lazy { this in listOf(ArraysOfPrimitives, RangesOfPrimitives, ProgressionsOfPrimitives, Primitives) }
|
||||
}
|
||||
|
||||
enum class PrimitiveType(val name: String) {
|
||||
Boolean : PrimitiveType("Boolean")
|
||||
Byte : PrimitiveType("Byte")
|
||||
Char : PrimitiveType("Char")
|
||||
Short : PrimitiveType("Short")
|
||||
Int : PrimitiveType("Int")
|
||||
Long : PrimitiveType("Long")
|
||||
Float : PrimitiveType("Float")
|
||||
Double : PrimitiveType("Double")
|
||||
Boolean("Boolean"),
|
||||
Byte("Byte"),
|
||||
Char("Char"),
|
||||
Short("Short"),
|
||||
Int("Int"),
|
||||
Long("Long"),
|
||||
Float("Float"),
|
||||
Double("Double")
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||
|
||||
private enum class AndroidClassType(val internalClassName: String, val supportsCache: Boolean = false) {
|
||||
ACTIVITY : AndroidClassType(AndroidConst.ACTIVITY_FQNAME.innerName, true)
|
||||
FRAGMENT : AndroidClassType(AndroidConst.FRAGMENT_FQNAME.innerName, true)
|
||||
SUPPORT_FRAGMENT_ACTIVITY : AndroidClassType(AndroidConst.SUPPORT_FRAGMENT_ACTIVITY_FQNAME.innerName, true)
|
||||
SUPPORT_FRAGMENT : AndroidClassType(AndroidConst.SUPPORT_FRAGMENT_FQNAME.innerName, true)
|
||||
VIEW : AndroidClassType(AndroidConst.VIEW_FQNAME.innerName)
|
||||
UNKNOWN : AndroidClassType("")
|
||||
ACTIVITY(AndroidConst.ACTIVITY_FQNAME.innerName, true),
|
||||
FRAGMENT(AndroidConst.FRAGMENT_FQNAME.innerName, true),
|
||||
SUPPORT_FRAGMENT_ACTIVITY(AndroidConst.SUPPORT_FRAGMENT_ACTIVITY_FQNAME.innerName, true),
|
||||
SUPPORT_FRAGMENT(AndroidConst.SUPPORT_FRAGMENT_FQNAME.innerName, true),
|
||||
VIEW(AndroidConst.VIEW_FQNAME.innerName),
|
||||
UNKNOWN("")
|
||||
}
|
||||
|
||||
private val String.innerName: String
|
||||
|
||||
Reference in New Issue
Block a user