Parser: Do not produce qualified expressions without receiver in package directives. Add assertion on JetQualifiedExpression
#KT-6907 Fixed
This commit is contained in:
@@ -0,0 +1 @@
|
||||
package .a b
|
||||
@@ -0,0 +1,18 @@
|
||||
JetFile: PackageLeadingDotDoubleID.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiErrorElement:Expecting a top level declaration
|
||||
<empty list>
|
||||
@@ -0,0 +1 @@
|
||||
package .a.b.c.
|
||||
@@ -0,0 +1,19 @@
|
||||
JetFile: PackageLongNameBetweenDots.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list placed on a single line
|
||||
<empty list>
|
||||
@@ -0,0 +1 @@
|
||||
package a b
|
||||
@@ -0,0 +1,16 @@
|
||||
JetFile: PackageLongNameDoubleID.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiWhiteSpace(' ')
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiErrorElement:Expecting a top level declaration
|
||||
<empty list>
|
||||
@@ -0,0 +1 @@
|
||||
package .a.b.c
|
||||
@@ -0,0 +1,16 @@
|
||||
JetFile: PackageLongNameLeadingDot.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
@@ -0,0 +1 @@
|
||||
package . .a.b.c
|
||||
@@ -0,0 +1,19 @@
|
||||
JetFile: PackageLongNameLeadingDoubleDot.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
@@ -0,0 +1 @@
|
||||
package . .
|
||||
@@ -0,0 +1,11 @@
|
||||
JetFile: PackageNameDoubleDot.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list placed on a single line
|
||||
<empty list>
|
||||
@@ -0,0 +1 @@
|
||||
package .
|
||||
@@ -0,0 +1,8 @@
|
||||
JetFile: PackageNameJustDot.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list placed on a single line
|
||||
<empty list>
|
||||
@@ -0,0 +1 @@
|
||||
package .a
|
||||
@@ -0,0 +1,8 @@
|
||||
JetFile: PackageSimpleNameLeadingDot.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
@@ -0,0 +1 @@
|
||||
package . .a
|
||||
@@ -0,0 +1,11 @@
|
||||
JetFile: PackageSimpleNameLeadingDoubleDot.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
PsiElement(package)('package')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Package name must be a '.'-separated identifier list
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
Reference in New Issue
Block a user