Comments binding (not complete yet)
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*/
|
||||
package foo.bar // package directive
|
||||
|
||||
import java.util.* // we need classes from java.util
|
||||
import javax.* // and from here too
|
||||
|
||||
// other imports
|
||||
import a.b
|
||||
import c.d
|
||||
|
||||
/**
|
||||
* Doc comment for A
|
||||
*/
|
||||
class A {}
|
||||
// after class A
|
||||
|
||||
// comment for B 1
|
||||
// comment for B 2
|
||||
class B {} // end of class B
|
||||
|
||||
/* Simple comment */
|
||||
class C // no body
|
||||
|
||||
class D {
|
||||
// This is v1
|
||||
val v1 = 1 // use 1
|
||||
/** v2 doc comment */
|
||||
val v2 = 2
|
||||
|
||||
// Function foo()
|
||||
fun foo(/* parameters */ p1: Int/* p1 */, p2: Int /* p2 */) {
|
||||
} // end of foo
|
||||
|
||||
// class object
|
||||
class object {
|
||||
} // end of class object
|
||||
}
|
||||
|
||||
// This is v
|
||||
val v = 1 // one
|
||||
|
||||
// This is fun
|
||||
public fun foo() {
|
||||
val local = 1 // this is local
|
||||
// declare another local
|
||||
val local2 = 2
|
||||
} // end
|
||||
|
||||
enum class E {
|
||||
A // this is A
|
||||
/** This is B */ B
|
||||
/* And this is C */ C
|
||||
/** This is X */
|
||||
X {
|
||||
override fun toString() = "X"
|
||||
} // end of X
|
||||
}
|
||||
|
||||
var prop: Int // Int
|
||||
get() = 1 // this is getter
|
||||
set(value) {} // this is setter
|
||||
|
||||
val prop2: Int get = 1 // prop2
|
||||
@@ -0,0 +1,391 @@
|
||||
JetFile: CommentsBinding.kt
|
||||
PsiComment(BLOCK_COMMENT)('/*\n * Copyright 2010-2014 JetBrains s.r.o.\n */')
|
||||
PsiWhiteSpace('\n')
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// package directive')
|
||||
PsiWhiteSpace('\n\n')
|
||||
IMPORT_LIST
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('java')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('util')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// we need classes from java.util')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('javax')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// and from here too')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PsiComment(EOL_COMMENT)('// other imports')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('d')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
KDoc
|
||||
PsiElement(KDOC_START)('/**')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(KDOC_LEADING_ASTERISK)('*')
|
||||
PsiElement(KDOC_TEXT)(' Doc comment for A')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(KDOC_END)('*/')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('// after class A')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
PsiComment(EOL_COMMENT)('// comment for B 1')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('// comment for B 2')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// end of class B')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
PsiComment(BLOCK_COMMENT)('/* Simple comment */')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('C')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// no body')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('D')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiComment(EOL_COMMENT)('// This is v1')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('v1')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// use 1')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
KDoc
|
||||
PsiElement(KDOC_START)('/**')
|
||||
PsiElement(KDOC_TEXT)(' v2 doc comment ')
|
||||
PsiElement(KDOC_END)('*/')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('v2')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
FUN
|
||||
PsiComment(EOL_COMMENT)('// Function foo()')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiComment(BLOCK_COMMENT)('/* parameters */')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p1')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiComment(BLOCK_COMMENT)('/* p1 */')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p2')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(BLOCK_COMMENT)('/* p2 */')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// end of foo')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CLASS_OBJECT
|
||||
PsiComment(EOL_COMMENT)('// class object')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
OBJECT_DECLARATION
|
||||
PsiElement(object)('object')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// end of class object')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiComment(EOL_COMMENT)('// This is v')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('v')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// one')
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiComment(EOL_COMMENT)('// This is fun')
|
||||
PsiWhiteSpace('\n')
|
||||
MODIFIER_LIST
|
||||
PsiElement(public)('public')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('local')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// this is local')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiComment(EOL_COMMENT)('// declare another local')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('local2')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('2')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// end')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
MODIFIER_LIST
|
||||
PsiElement(enum)('enum')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('E')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
ENUM_ENTRY
|
||||
OBJECT_DECLARATION_NAME
|
||||
PsiElement(IDENTIFIER)('A')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// this is A')
|
||||
PsiWhiteSpace('\n ')
|
||||
ENUM_ENTRY
|
||||
OBJECT_DECLARATION_NAME
|
||||
KDoc
|
||||
PsiElement(KDOC_START)('/**')
|
||||
PsiElement(KDOC_TEXT)(' This is B ')
|
||||
PsiElement(KDOC_END)('*/')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiWhiteSpace('\n ')
|
||||
ENUM_ENTRY
|
||||
PsiComment(BLOCK_COMMENT)('/* And this is C */')
|
||||
PsiWhiteSpace(' ')
|
||||
OBJECT_DECLARATION_NAME
|
||||
PsiElement(IDENTIFIER)('C')
|
||||
PsiWhiteSpace('\n ')
|
||||
ENUM_ENTRY
|
||||
OBJECT_DECLARATION_NAME
|
||||
KDoc
|
||||
PsiElement(KDOC_START)('/**')
|
||||
PsiElement(KDOC_TEXT)(' This is X ')
|
||||
PsiElement(KDOC_END)('*/')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
FUN
|
||||
MODIFIER_LIST
|
||||
PsiElement(override)('override')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('toString')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
STRING_TEMPLATE
|
||||
PsiElement(OPEN_QUOTE)('"')
|
||||
LITERAL_STRING_TEMPLATE_ENTRY
|
||||
PsiElement(REGULAR_STRING_PART)('X')
|
||||
PsiElement(CLOSING_QUOTE)('"')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// end of X')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(var)('var')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('prop')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// Int')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_ACCESSOR
|
||||
PsiElement(get)('get')
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// this is getter')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_ACCESSOR
|
||||
PsiElement(set)('set')
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('value')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// this is setter')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('prop2')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace(' ')
|
||||
PROPERTY_ACCESSOR
|
||||
PsiElement(get)('get')
|
||||
PsiErrorElement:Accessor body expected
|
||||
<empty list>
|
||||
PsiErrorElement:Expecting '('
|
||||
<empty list>
|
||||
PsiErrorElement:Expecting ')'
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// prop2')
|
||||
@@ -1596,9 +1596,9 @@ JetFile: BinaryTree.kt
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiComment(EOL_COMMENT)('// Relies on tail-recursion optimization')
|
||||
PsiWhiteSpace('\n ')
|
||||
FUN
|
||||
PsiComment(EOL_COMMENT)('// Relies on tail-recursion optimization')
|
||||
PsiWhiteSpace('\n ')
|
||||
MODIFIER_LIST
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
|
||||
@@ -291,7 +291,7 @@ JetFile: Builder.kt
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('ClassPathEntry')
|
||||
PsiComment(BLOCK_COMMENT)('/*...*/')
|
||||
PsiComment(BLOCK_COMMENT)('/*...*/')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
@@ -371,7 +371,7 @@ JetFile: Builder.kt
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('ClassPathEntry')
|
||||
PsiComment(BLOCK_COMMENT)('/*...*/')
|
||||
PsiComment(BLOCK_COMMENT)('/*...*/')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
|
||||
@@ -26,9 +26,9 @@ JetFile: FunctionsAndTypes.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('// type f1 = {(T) => X}')
|
||||
PsiWhiteSpace('\n')
|
||||
TYPEDEF
|
||||
PsiComment(EOL_COMMENT)('// type f1 = {(T) => X}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(typealias)('typealias')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('f2')
|
||||
@@ -60,9 +60,9 @@ JetFile: FunctionsAndTypes.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('// type f2 = {(T, E) => X}')
|
||||
PsiWhiteSpace('\n')
|
||||
TYPEDEF
|
||||
PsiComment(EOL_COMMENT)('// type f2 = {(T, E) => X}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(typealias)('typealias')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('f_tuple')
|
||||
@@ -102,9 +102,9 @@ JetFile: FunctionsAndTypes.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('//type f_tuple = {((T, E)) => X}')
|
||||
PsiWhiteSpace('\n')
|
||||
TYPEDEF
|
||||
PsiComment(EOL_COMMENT)('//type f_tuple = {((T, E)) => X}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(typealias)('typealias')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('hof')
|
||||
@@ -142,9 +142,9 @@ JetFile: FunctionsAndTypes.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Y')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('//type hof = { (X) => {(T) => Y} }')
|
||||
PsiWhiteSpace('\n')
|
||||
TYPEDEF
|
||||
PsiComment(EOL_COMMENT)('//type hof = { (X) => {(T) => Y} }')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(typealias)('typealias')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('hof2')
|
||||
@@ -246,9 +246,9 @@ JetFile: FunctionsAndTypes.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('//type Comparison<in T> = {(a : T, b : T) => Int}')
|
||||
PsiWhiteSpace('\n')
|
||||
TYPEDEF
|
||||
PsiComment(EOL_COMMENT)('//type Comparison<in T> = {(a : T, b : T) => Int}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(typealias)('typealias')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Equality')
|
||||
@@ -296,9 +296,9 @@ JetFile: FunctionsAndTypes.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Boolean')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('//type Equality<in T> = {(a : T, b : T) => Boolean}')
|
||||
PsiWhiteSpace('\n')
|
||||
TYPEDEF
|
||||
PsiComment(EOL_COMMENT)('//type Equality<in T> = {(a : T, b : T) => Boolean}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(typealias)('typealias')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('HashFunction')
|
||||
@@ -335,9 +335,9 @@ JetFile: FunctionsAndTypes.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('//type HashFunction<in T> = {(obj : T) => Int}')
|
||||
PsiWhiteSpace('\n')
|
||||
TYPEDEF
|
||||
PsiComment(EOL_COMMENT)('//type HashFunction<in T> = {(obj : T) => Int}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(typealias)('typealias')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Runnable')
|
||||
@@ -357,9 +357,9 @@ JetFile: FunctionsAndTypes.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Unit')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('//type Runnable = {() => ()}')
|
||||
PsiWhiteSpace('\n')
|
||||
TYPEDEF
|
||||
PsiComment(EOL_COMMENT)('//type Runnable = {() => ()}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(typealias)('typealias')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Function1')
|
||||
|
||||
@@ -135,8 +135,8 @@ JetFile: Graph.kt
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// type is ArrayList, but I want IMutableList')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// type is ArrayList, but I want IMutableList')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(BLOCK_COMMENT)('/* options:\n private val edges : IMutableList<Edge<V, E>> = ArrayList<Edge<V, E>>()\n private val edges : IMutableList<Edge<V, E>> = ArrayList() // not an erasure, but a request to infer parameters\n*/')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
@@ -457,8 +457,8 @@ JetFile: Graph.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('to')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// type is IIterable<Vertex<V>>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// type is IIterable<Vertex<V>>')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
|
||||
@@ -119,9 +119,9 @@ JetFile: UpdateOperation.kt
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PsiComment(EOL_COMMENT)('// One can say:')
|
||||
PsiWhiteSpace('\n')
|
||||
PROPERTY
|
||||
PsiComment(EOL_COMMENT)('// One can say:')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
|
||||
@@ -555,8 +555,8 @@ JetFile: IOSamples.kt
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('File')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('//= ...')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('//= ...')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
@@ -569,8 +569,8 @@ JetFile: IOSamples.kt
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('File')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('//= ...')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('//= ...')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
|
||||
@@ -409,9 +409,9 @@ JetFile: FunctionsWithFunctionReceivers.kt
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PsiComment(EOL_COMMENT)('//--------------')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiComment(EOL_COMMENT)('//--------------')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
|
||||
@@ -45,8 +45,8 @@ JetFile: FunctionTypesAsArguments.kt
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// multiple errors')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// multiple errors')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
|
||||
@@ -788,11 +788,11 @@ JetFile: functionTypes.kt
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('B')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('//val a9 : (A, B)')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('//val a10 : (B)? -> B')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY
|
||||
PsiComment(EOL_COMMENT)('//val a9 : (A, B)')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiComment(EOL_COMMENT)('//val a10 : (B)? -> B')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('a11')
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
JetFile: InvalidCharInSingleLineLambda.kt
|
||||
PsiComment(EOL_COMMENT)('// checks that invalid characters (inserted e.g. by completion) inside single-line block do not cause wrong scopes for declarations below')
|
||||
PsiWhiteSpace('\n')
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiComment(EOL_COMMENT)('// checks that invalid characters (inserted e.g. by completion) inside single-line block do not cause wrong scopes for declarations below')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
|
||||
@@ -7,8 +7,8 @@ JetFile: PackageRecovery.kt
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list placed on a single line
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// Hello')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// Hello')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
|
||||
Reference in New Issue
Block a user