drop deprecated syntax for anonymous initializer blocks

This commit is contained in:
Dmitry Jemerov
2015-04-24 18:37:27 +02:00
parent 35e82d4574
commit 98b8784ab0
52 changed files with 61 additions and 816 deletions
@@ -1,6 +1,6 @@
class Foo {
{
init {
foo()
val c = f
}
@@ -10,6 +10,8 @@ JetFile: AnonymousInitializer.kt
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n\n ')
ANONYMOUS_INITIALIZER
PsiElement(init)('init')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
@@ -3,13 +3,13 @@ class Foo() {
var b : Int get() = 1; set
var b1 : Int get() = 1; set {1}
val b2 : Int get
{
init {
}
val b3 : Int get {
return 1
}
val b4 : Int get; {
val b4 : Int get; init {
}
var b5 : Int get abstract set
@@ -123,6 +123,8 @@ JetFile: PropertiesFollowedByInitializers.kt
PsiElement(get)('get')
PsiWhiteSpace('\n ')
ANONYMOUS_INITIALIZER
PsiElement(init)('init')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n\n ')
@@ -177,6 +179,8 @@ JetFile: PropertiesFollowedByInitializers.kt
PsiElement(SEMICOLON)(';')
PsiWhiteSpace(' ')
ANONYMOUS_INITIALIZER
PsiElement(init)('init')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
@@ -17,7 +17,7 @@ class Foo {
foo bar(1) buzz<T>(1) zoo var v : Int = 0
foo bar(1) buzz<T>(1) zoo typealias T = Int
foo bar(1) buzz<T>(1) zoo {}
foo bar(1) buzz<T>(1) zoo init {}
}
fun test() {
@@ -896,6 +896,8 @@ JetFile: ShortAnnotations.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PsiElement(init)('init')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
+3 -3
View File
@@ -13,11 +13,11 @@ class BinaryTree<T> : IMutableSet<T> {
// override var size : Int { get; private set; }
this(compare : Comparison<T>) {
constructor(compare : Comparison<T>) {
this.compare = asMatchableComparison(comparison)
}
this() : this(naturalOrder<T>()) {
constructor() : this(naturalOrder<T>()) {
}
private [operator] fun T.compareTo(other : T) : Int = compare(this, other)
@@ -135,7 +135,7 @@ class BinaryTree<T> : IMutableSet<T> {
val up = Stack<TreeNode>()
var lastNode : TreeNode
this() {
init {
if (root != null)
down.push(root)
}
+34 -53
View File
@@ -151,24 +151,15 @@ JetFile: BinaryTree.kt
PsiWhiteSpace('\n\n')
PsiComment(EOL_COMMENT)('// override var size : Int { get; private set; }')
PsiWhiteSpace('\n\n ')
PsiErrorElement:Expecting member declaration
PsiElement(this)('this')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
MODIFIER_LIST
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('compare')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
MODIFIER_LIST
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
SECONDARY_CONSTRUCTOR
PsiElement(constructor)('constructor')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
PsiElement(IDENTIFIER)('compare')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
@@ -181,10 +172,11 @@ JetFile: BinaryTree.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
ANONYMOUS_INITIALIZER
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
CONSTRUCTOR_DELEGATION_CALL
CONSTRUCTOR_DELEGATION_REFERENCE
<empty list>
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
@@ -212,25 +204,21 @@ JetFile: BinaryTree.kt
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
PsiErrorElement:Expecting member declaration
PsiElement(this)('this')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
SECONDARY_CONSTRUCTOR
PsiElement(constructor)('constructor')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(this)('this')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
MODIFIER_LIST
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
PsiWhiteSpace(' ')
CONSTRUCTOR_DELEGATION_CALL
CONSTRUCTOR_DELEGATION_REFERENCE
PsiElement(this)('this')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('naturalOrder')
TYPE_ARGUMENT_LIST
@@ -241,13 +229,11 @@ JetFile: BinaryTree.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiElement(RPAR)(')')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
ANONYMOUS_INITIALIZER
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
@@ -1819,14 +1805,9 @@ JetFile: BinaryTree.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('TreeNode')
PsiWhiteSpace('\n\n ')
PsiErrorElement:Expecting member declaration
PsiElement(this)('this')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
ANONYMOUS_INITIALIZER
PsiElement(init)('init')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
@@ -7,12 +7,4 @@ class A {
init {
x = 1
}
val y = f()
{
x = 2
}
{
x = 3
}
}
@@ -57,55 +57,5 @@ JetFile: anonymousInitializer.kt
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('y')
PsiWhiteSpace(' ')
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('f')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_ARGUMENT
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
BLOCK
BINARY_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('2')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_ARGUMENT
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
BLOCK
BINARY_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('3')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
@@ -9,7 +9,7 @@ enum class A {
abc3
constructor(x: Int): this() {}
{
init {
}
}
@@ -131,6 +131,8 @@ JetFile: enumParsing.kt
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
ANONYMOUS_INITIALIZER
PsiElement(init)('init')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n\n ')