[BE IR] Skip comments for determining startOffset of declaration

This commit is contained in:
Dmitry Savvinov
2018-04-18 17:57:47 +03:00
committed by Dmitry Savvinov
parent 633f665b7f
commit 00036ba498
25 changed files with 267 additions and 169 deletions
+34
View File
@@ -0,0 +1,34 @@
// One-line comment
class Foo {
// Several
// lines
// of
// oneline
// commentaries
inner class Inner /* comment for constructor */ private constructor(x: Int) {
/** dangling comment at the end of body*/
} // Comment for closing bracket
/*
very
long
multiline
comment
*/
protected open fun foo(y: Int) { // Comment for opening bracket
/* Comment for closing bracket */ }
/**
* Javadoc comment
*/
val x: Int = 42
// Comment for getter
get() = field + 1
// Dangling comment
fun test() {
foo(/* comment inside call */ 42)
}
}
+51
View File
@@ -0,0 +1,51 @@
@0:0..33:1 FILE fqName:<root> fileName:/comments.kt
@1:0..33:1 CLASS CLASS name:Foo modality:FINAL visibility:public flags: superTypes:[kotlin.Any]
@1:0..33:1 VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:Foo flags:
@1:0..33:1 CONSTRUCTOR visibility:public <> () returnType:Foo flags:primary
@1:0..33:1 BLOCK_BODY
@1:0..33:1 DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
@1:0..33:1 INSTANCE_INITIALIZER_CALL classDescriptor='Foo'
@8:4..10:36 CLASS CLASS name:Inner modality:FINAL visibility:public flags:inner superTypes:[kotlin.Any]
@8:4..10:36 VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:Foo.Inner flags:
@8:4..10:36 CONSTRUCTOR visibility:private <> ($this:Foo, x:kotlin.Int) returnType:Foo.Inner flags:primary
@8:52..79 VALUE_PARAMETER name:<this> type:Foo flags:
@8:72..78 VALUE_PARAMETER name:x index:0 type:kotlin.Int flags:
@8:4..10:36 BLOCK_BODY
@8:4..10:36 DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
@8:4..10:36 INSTANCE_INITIALIZER_CALL classDescriptor='Inner'
@8:4..10:36 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:
@8:4..10:36 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
@8:4..10:36 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:
@8:4..10:36 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@8:4..10:36 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:
@8:4..10:36 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@18:4..20:39 FUN name:foo visibility:protected modality:OPEN <> ($this:Foo, y:kotlin.Int) returnType:kotlin.Unit flags:
@18:4..20:39 VALUE_PARAMETER name:<this> type:Foo flags:
@18:27..33 VALUE_PARAMETER name:y index:0 type:kotlin.Int flags:
@18:35..20:39 BLOCK_BODY
@25:4..27:25 PROPERTY name:x visibility:public modality:FINAL flags:val
@25:4..27:25 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public flags:final
@25:17..19 EXPRESSION_BODY
@25:17..19 CONST Int type=kotlin.Int value=42
@27:8..25 FUN name:<get-x> visibility:public modality:FINAL <> ($this:Foo) returnType:kotlin.Int flags:
@27:8..25 VALUE_PARAMETER name:<this> type:Foo flags:
@27:16..25 BLOCK_BODY
@27:16..25 RETURN type=kotlin.Nothing from='<get-x>(): Int'
@27:16..25 CALL 'plus(Int): Int' type=kotlin.Int origin=PLUS
@27:16..21 GET_FIELD 'x: Int' type=kotlin.Int origin=null
@27:16..21 GET_VAR 'this@Foo: Foo' type=Foo origin=null
@27:24..25 CONST Int type=kotlin.Int value=1
@30:4..32:5 FUN name:test visibility:public modality:FINAL <> ($this:Foo) returnType:kotlin.Unit flags:
@30:4..32:5 VALUE_PARAMETER name:<this> type:Foo flags:
@30:15..32:5 BLOCK_BODY
@31:8..41 CALL 'foo(Int): Unit' type=kotlin.Unit origin=null
@31:8..41 GET_VAR 'this@Foo: Foo' type=Foo origin=null
@31:38..40 CONST Int type=kotlin.Int value=42
@1:0..33:1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:
@1:0..33:1 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
@1:0..33:1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:
@1:0..33:1 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@1:0..33:1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:
@1:0..33:1 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
+16 -16
View File
@@ -1,24 +1,24 @@
@0:0..26:1 FILE fqName:<root> fileName:/kt17108.kt
@0:0..26:1 CLASS INTERFACE name:Boolean modality:ABSTRACT visibility:public flags: superTypes:[kotlin.Any]
@0:0..26:1 VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:Boolean flags:
@5:4..8:38 FUN name:not visibility:public modality:ABSTRACT <> ($this:Boolean) returnType:Boolean flags:
@5:4..8:38 VALUE_PARAMETER name:<this> type:Boolean flags:
@10:4..13:42 FUN name:and visibility:public modality:ABSTRACT <> ($this:Boolean, other:Boolean) returnType:Boolean flags:
@10:4..13:42 VALUE_PARAMETER name:<this> type:Boolean flags:
@4:0..26:1 CLASS INTERFACE name:Boolean modality:ABSTRACT visibility:public flags: superTypes:[kotlin.Any]
@4:0..26:1 VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:Boolean flags:
@8:4..38 FUN name:not visibility:public modality:ABSTRACT <> ($this:Boolean) returnType:Boolean flags:
@8:4..38 VALUE_PARAMETER name:<this> type:Boolean flags:
@13:4..42 FUN name:and visibility:public modality:ABSTRACT <> ($this:Boolean, other:Boolean) returnType:Boolean flags:
@13:4..42 VALUE_PARAMETER name:<this> type:Boolean flags:
@13:18..32 VALUE_PARAMETER name:other index:0 type:Boolean flags:
@15:4..18:41 FUN name:or visibility:public modality:ABSTRACT <> ($this:Boolean, other:Boolean) returnType:Boolean flags:
@15:4..18:41 VALUE_PARAMETER name:<this> type:Boolean flags:
@18:4..41 FUN name:or visibility:public modality:ABSTRACT <> ($this:Boolean, other:Boolean) returnType:Boolean flags:
@18:4..41 VALUE_PARAMETER name:<this> type:Boolean flags:
@18:17..31 VALUE_PARAMETER name:other index:0 type:Boolean flags:
@20:4..23:42 FUN name:xor visibility:public modality:ABSTRACT <> ($this:Boolean, other:Boolean) returnType:Boolean flags:
@20:4..23:42 VALUE_PARAMETER name:<this> type:Boolean flags:
@23:4..42 FUN name:xor visibility:public modality:ABSTRACT <> ($this:Boolean, other:Boolean) returnType:Boolean flags:
@23:4..42 VALUE_PARAMETER name:<this> type:Boolean flags:
@23:18..32 VALUE_PARAMETER name:other index:0 type:Boolean flags:
@25:4..38 FUN name:compareTo visibility:public modality:ABSTRACT <> ($this:Boolean, other:Boolean) returnType:kotlin.Int flags:
@25:4..38 VALUE_PARAMETER name:<this> type:Boolean flags:
@25:18..32 VALUE_PARAMETER name:other index:0 type:Boolean flags:
@0:0..26:1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:
@0:0..26:1 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@4:0..26:1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:
@4:0..26:1 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
@0:0..26:1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:
@0:0..26:1 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@0:0..26:1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:
@0:0..26:1 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@4:0..26:1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:
@4:0..26:1 VALUE_PARAMETER name:<this> type:kotlin.Any flags:
@4:0..26:1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:
@4:0..26:1 VALUE_PARAMETER name:<this> type:kotlin.Any flags: