Enum parsing changed: first entries, then members. Grammar fixed accordingly.

A set of compiler tests and some plugin tests changed accordingly.
Compiler Kotlin code changed accordingly.
This commit is contained in:
Mikhail Glukhikh
2015-05-05 12:41:20 +03:00
parent 7a4dee44b8
commit cf741cb868
23 changed files with 243 additions and 103 deletions
@@ -1,12 +1,6 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetNamedFunction
// OPTIONS: usages
enum class E {
init {
foo(1)
}
open fun <caret>foo(n: Int): Int = n
O
A {
init {
@@ -22,4 +16,10 @@ enum class E {
override fun foo(n: Int): Int = n + 2
}
init {
foo(1)
}
open fun <caret>foo(n: Int): Int = n
}
@@ -1,3 +1,3 @@
Function call (13: 13) foo(1)
Function call (20: 13) foo(1)
Function call (5: 9) foo(1)
Function call (14: 13) foo(1)
Function call (21: 9) foo(1)
Function call (7: 13) foo(1)
@@ -29,9 +29,9 @@ interface T1
// -----
enum class E1 {
object O7
ENTRY
object O7
}
// -----
@@ -67,9 +67,9 @@ interface T2
// -----
enum class E2 {
object O14 {}
ENTRY
object O14 {}
}
// -----
@@ -110,8 +110,8 @@ interface T3
// -----
enum class E3 {
ENTRY
object O21 {
}
ENTRY
}
@@ -24,8 +24,8 @@ interface T1
// -----
enum class E1 {
object O7
ENTRY
object O7
}
// -----
@@ -56,8 +56,8 @@ interface T2
// -----
enum class E2 {
object O14 {}
ENTRY
object O14 {}
}
// -----
@@ -93,7 +93,7 @@ interface T3
// -----
enum class E3 {
ENTRY
object O21 {
}
ENTRY
}
@@ -1,6 +1,4 @@
enum class <caret>E {
open fun foo(n: Int): Int = n
O
A {
override fun foo(n: Int): Int = n + 1
@@ -10,6 +8,8 @@ enum class <caret>E {
override fun foo(n: Int): Int = n + 2
}
open fun foo(n: Int): Int = n
}
// REF: (E).A
@@ -1,6 +1,4 @@
enum class E {
open fun <caret>foo(n: Int): Int = n
O
A {
override fun foo(n: Int): Int = n + 1
@@ -10,6 +8,8 @@ enum class E {
override fun foo(n: Int): Int = n + 2
}
open fun <caret>foo(n: Int): Int = n
}
// REF: (in E.A).foo(Int)
@@ -1,6 +1,4 @@
enum class E {
open fun foo(n: Int, s: String): Int = n
O
A {
override fun foo(n: Int, s: String): Int = n + 1
@@ -10,4 +8,6 @@ enum class E {
override fun foo(n: Int, s: String): Int = n + 2
}
open fun foo(n: Int, s: String): Int = n
}
@@ -1,6 +1,4 @@
enum class E {
open fun <caret>foo(n: Int): Int = n
O
A {
override fun foo(n: Int): Int = n + 1
@@ -10,4 +8,6 @@ enum class E {
override fun foo(n: Int): Int = n + 2
}
open fun <caret>foo(n: Int): Int = n
}
@@ -1,8 +1,6 @@
package test
enum class E {
open fun bar(n: Int): Int = n
O
A {
override fun bar(n: Int): Int = n + 1
@@ -12,4 +10,6 @@ enum class E {
override fun bar(n: Int): Int = n + 2
}
open fun bar(n: Int): Int = n
}
@@ -1,8 +1,6 @@
package test
enum class E {
open fun foo(n: Int): Int = n
O
A {
override fun foo(n: Int): Int = n + 1
@@ -12,4 +10,6 @@ enum class E {
override fun foo(n: Int): Int = n + 2
}
open fun foo(n: Int): Int = n
}