New source mapping

This commit is contained in:
Michael Bogdanov
2016-04-18 17:56:08 +03:00
parent cb615c557a
commit ff820bddc0
18 changed files with 575 additions and 18 deletions
@@ -33,7 +33,10 @@ fun box(): String {
// FILE: 2.smap
//TODO SHOULD BE LESS
//TODO
//7#1,3:26
//10#1,6:30 - could be merged in one big interval due preprocessing of inline function
SMAP
2.kt
Kotlin
@@ -45,7 +48,10 @@ _2Kt
builders/_1Kt
*L
1#1,24:1
7#1,3:26
10#1,6:30
6#2:25
6#2:29
*E
SMAP
@@ -35,7 +35,9 @@ fun box(): String {
// FILE: 2.smap
//TODO SHOULD BE LESS
//7#1,3:28
//10#1,8:32 - could be merged in one big interval due preprocessing of inline function
SMAP
2.kt
Kotlin
@@ -47,7 +49,10 @@ _2Kt
builders/_1Kt
*L
1#1,26:1
7#1,3:28
10#1,8:32
6#2:27
6#2:31
*E
SMAP
@@ -32,7 +32,6 @@ inline fun test(z: () -> Unit) {
// FILE: 2.smap
//PROBLEM of KT-11478 in additional line mapping for default source (so 'single' was replaces with 'first' in SMAP class init):
//*L
//1#1,15:1
//17#1:19
@@ -66,11 +65,7 @@ test/_1Kt
_2Kt
*L
1#1,17:1
21#1:23
13#2,2:18
5#2:18
18#2:19
9#2:20
19#2,2:20
7#3:22
7#3:21
*E
+3 -2
View File
@@ -36,7 +36,7 @@ fun box(): String {
}
// FILE: 1.smap
//TODO maybe do smth with default method body mapping
SMAP
1.kt
Kotlin
@@ -46,6 +46,7 @@ Kotlin
test/_1Kt
*L
1#1,25:1
18#1,6:26
*E
// FILE: 2.smap
@@ -63,4 +64,4 @@ test/_1Kt
1#1,14:1
17#2,7:15
8#2,7:22
*E
*E
@@ -0,0 +1,46 @@
// FILE: 1.kt
package test
inline fun test(s: () -> Unit) {
val z = 1;
s()
val x = 1;
}
// FILE: 2.kt
import test.*
fun box(): String {
var result = "fail"
test {
result = "O"
}
test {
result += "K"
}
return result
}
// FILE: 1.smap
// FILE: 2.smap
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt
+ 2 1.kt
test/_1Kt
*L
1#1,18:1
6#2,4:19
6#2,4:23
*E
@@ -0,0 +1,79 @@
// FILE: 1.kt
package test
inline fun myrun(s: () -> Unit) {
val z = "myrun"
s()
}
inline fun test(crossinline s: () -> Unit) {
{
val z = 1;
myrun(s)
val x = 1;
}()
}
// FILE: 2.kt
import test.*
fun box(): String {
var result = "fail"
test {
result = "OK"
}
return result
}
// FILE: 1.smap
SMAP
1.kt
Kotlin
*S Kotlin
*F
+ 1 1.kt
test/_1Kt$test$1
+ 2 1.kt
test/_1Kt
*L
1#1,18:1
6#2,3:19
*E
// FILE: 2.smap
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt
+ 2 1.kt
test/_1Kt
*L
1#1,16:1
11#2,6:17
*E
SMAP
1.kt
Kotlin
*S Kotlin
*F
+ 1 1.kt
test/_1Kt$test$1
+ 2 1.kt
test/_1Kt
+ 3 2.kt
_2Kt
*L
1#1,18:1
6#2,3:19
9#3,2:22
*E
@@ -0,0 +1,66 @@
// FILE: 1.kt
package test
inline fun test(s: () -> Unit) {
val z = 1;
s()
val x = 1;
}
inline fun test2(s: () -> String): String {
val z = 1;
val res = s()
return res
}
// FILE: 2.kt
import test.*
fun box(): String {
var result = "fail"
test {
{
result = test2 {
"OK"
}
}()
}
return result
}
// FILE: 1.smap
// FILE: 2.smap
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt
+ 2 1.kt
test/_1Kt
*L
1#1,20:1
6#2,4:21
*E
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt$box$1$1
+ 2 1.kt
test/_1Kt
*L
1#1,20:1
12#2,3:21
*E
@@ -0,0 +1,66 @@
// FILE: 1.kt
package test
inline fun test(s: () -> Unit) {
val z = 1;
s()
val x = 1;
}
// FILE: 2.kt
import test.*
inline fun test2(s: () -> String): String {
val z = 1;
val res = s()
return res
}
fun box(): String {
var result = "fail"
test {
{
result = test2 {
"OK"
}
}()
}
return result
}
// FILE: 1.smap
// FILE: 2.smap
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt
+ 2 1.kt
test/_1Kt
*L
1#1,26:1
6#2,4:27
*E
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt$box$1$1
+ 2 2.kt
_2Kt
*L
1#1,26:1
6#2,3:27
*E
+1
View File
@@ -32,4 +32,5 @@ Kotlin
_2Kt
*L
1#1,15:1
10#1,3:16
*E
+4 -2
View File
@@ -11,7 +11,7 @@ inline fun initTag2(init: () -> Unit) {
init()
}
//{val p = initTag2(init); return p} to remove difference in linenumber processing through MethodNode and MethodVisitor should be: = initTag2(init)
inline fun head(init: () -> Unit) {val p = initTag2(init); return p}
inline fun head(init: () -> Unit) { val p = initTag2(init); return p}
inline fun html(init: () -> Unit) {
@@ -44,7 +44,6 @@ fun box(): String {
// FILE: 1.smap
//TODO SHOULD BE EMPTY
SMAP
1.kt
Kotlin
@@ -54,10 +53,13 @@ Kotlin
builders/_1Kt
*L
1#1,21:1
10#1,3:22
6#1,2:25
*E
// FILE: 2.smap
SMAP
2.kt
Kotlin