Parser: Do not produce qualified expressions without receiver in package directives. Add assertion on JetQualifiedExpression

#KT-6907 Fixed
This commit is contained in:
Alexey Sedunov
2015-03-05 14:49:29 +03:00
parent cab301e8e2
commit 2684ce20d4
25 changed files with 235 additions and 25 deletions
@@ -0,0 +1,36 @@
JetFile: PackageBlockFirst.kt
PACKAGE_DIRECTIVE
PsiElement(package)('package')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foobar')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting a top level declaration
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n ')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace(' ')
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foobar')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n')
PsiErrorElement:Expecting a top level declaration
PsiElement(RBRACE)('}')