Change parsing of annotations on block level expressions
Attach annotations to the closest prefix expression instead of whole statement if no new line found after annotations The motivation is for a simple annotated expression like '@ann x + y' its syntax form must not change after prepending 'val z = ' just before it
This commit is contained in:
@@ -3,11 +3,21 @@ fun foo() {
|
||||
var x0 = foo0()
|
||||
|
||||
@ann1
|
||||
// comment
|
||||
/* comment */
|
||||
x1 = foo1()
|
||||
|
||||
// many empty new lines
|
||||
@ann2
|
||||
|
||||
|
||||
x2 += foo2()
|
||||
|
||||
@ann21 @ann22
|
||||
|
||||
@ann23
|
||||
x22 += foo22()
|
||||
|
||||
for (i in 1..100) {
|
||||
@ann3
|
||||
x3 += foo3()
|
||||
|
||||
Reference in New Issue
Block a user