FIC: Parse fun keyword in front of interface as a modifier
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
interface fun Foo
|
||||
|
||||
fun private interface Foo
|
||||
|
||||
fun @Bar interface Foo
|
||||
|
||||
fun class Foo
|
||||
|
||||
fun abstract class Foo
|
||||
|
||||
fun object Foo
|
||||
@@ -0,0 +1,79 @@
|
||||
KtFile: kotlinFunInterface_ERR.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
IMPORT_LIST
|
||||
<empty list>
|
||||
CLASS
|
||||
PsiElement(interface)('interface')
|
||||
PsiErrorElement:Name expected
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Expecting '('
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('private')
|
||||
PsiErrorElement:Expecting '('
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Annotations are not allowed in this position
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiErrorElement:Expecting function name or receiver type
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiErrorElement:Expecting function name or receiver type
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('abstract')
|
||||
PsiErrorElement:Expecting '('
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace('\n\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiErrorElement:Expecting function name or receiver type
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
OBJECT_DECLARATION
|
||||
PsiElement(object)('object')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
@@ -0,0 +1,17 @@
|
||||
fun interface Foo
|
||||
|
||||
fun interface Foo {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
private fun interface Foo
|
||||
|
||||
@Bar
|
||||
fun interface Foo
|
||||
|
||||
class TopLevel {
|
||||
fun interface Foo
|
||||
}
|
||||
|
||||
fun
|
||||
interface Foo
|
||||
@@ -0,0 +1,85 @@
|
||||
KtFile: validKotlinFunInterface.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
IMPORT_LIST
|
||||
<empty list>
|
||||
CLASS
|
||||
MODIFIER_LIST
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
MODIFIER_LIST
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('invoke')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
MODIFIER_LIST
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('TopLevel')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
CLASS
|
||||
MODIFIER_LIST
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
MODIFIER_LIST
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(interface)('interface')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
Reference in New Issue
Block a user