From 2684ce20d44bca2f939899b35918b5328a35f5f2 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Thu, 5 Mar 2015 14:49:29 +0300 Subject: [PATCH] Parser: Do not produce qualified expressions without receiver in package directives. Add assertion on JetQualifiedExpression #KT-6907 Fixed --- .../jetbrains/kotlin/parsing/JetParsing.java | 19 +++- .../kotlin/psi/JetQualifiedExpressionImpl.kt | 18 ++-- .../psi/{ => packages}/PackageBlockFirst.kt | 0 .../psi/{ => packages}/PackageBlockFirst.txt | 0 .../psi/packages/PackageLeadingDotDoubleID.kt | 1 + .../packages/PackageLeadingDotDoubleID.txt | 18 ++++ .../packages/PackageLongNameBetweenDots.kt | 1 + .../packages/PackageLongNameBetweenDots.txt | 19 ++++ .../psi/packages/PackageLongNameDoubleID.kt | 1 + .../psi/packages/PackageLongNameDoubleID.txt | 16 ++++ .../psi/packages/PackageLongNameLeadingDot.kt | 1 + .../packages/PackageLongNameLeadingDot.txt | 16 ++++ .../PackageLongNameLeadingDoubleDot.kt | 1 + .../PackageLongNameLeadingDoubleDot.txt | 19 ++++ .../psi/{ => packages}/PackageModifiers.kt | 0 .../psi/{ => packages}/PackageModifiers.txt | 0 .../psi/packages/PackageNameDoubleDot.kt | 1 + .../psi/packages/PackageNameDoubleDot.txt | 11 +++ .../psi/packages/PackageNameJustDot.kt | 1 + .../psi/packages/PackageNameJustDot.txt | 8 ++ .../packages/PackageSimpleNameLeadingDot.kt | 1 + .../packages/PackageSimpleNameLeadingDot.txt | 8 ++ .../PackageSimpleNameLeadingDoubleDot.kt | 1 + .../PackageSimpleNameLeadingDoubleDot.txt | 11 +++ .../parsing/JetParsingTestGenerated.java | 88 ++++++++++++++++--- 25 files changed, 235 insertions(+), 25 deletions(-) rename compiler/testData/psi/{ => packages}/PackageBlockFirst.kt (100%) rename compiler/testData/psi/{ => packages}/PackageBlockFirst.txt (100%) create mode 100644 compiler/testData/psi/packages/PackageLeadingDotDoubleID.kt create mode 100644 compiler/testData/psi/packages/PackageLeadingDotDoubleID.txt create mode 100644 compiler/testData/psi/packages/PackageLongNameBetweenDots.kt create mode 100644 compiler/testData/psi/packages/PackageLongNameBetweenDots.txt create mode 100644 compiler/testData/psi/packages/PackageLongNameDoubleID.kt create mode 100644 compiler/testData/psi/packages/PackageLongNameDoubleID.txt create mode 100644 compiler/testData/psi/packages/PackageLongNameLeadingDot.kt create mode 100644 compiler/testData/psi/packages/PackageLongNameLeadingDot.txt create mode 100644 compiler/testData/psi/packages/PackageLongNameLeadingDoubleDot.kt create mode 100644 compiler/testData/psi/packages/PackageLongNameLeadingDoubleDot.txt rename compiler/testData/psi/{ => packages}/PackageModifiers.kt (100%) rename compiler/testData/psi/{ => packages}/PackageModifiers.txt (100%) create mode 100644 compiler/testData/psi/packages/PackageNameDoubleDot.kt create mode 100644 compiler/testData/psi/packages/PackageNameDoubleDot.txt create mode 100644 compiler/testData/psi/packages/PackageNameJustDot.kt create mode 100644 compiler/testData/psi/packages/PackageNameJustDot.txt create mode 100644 compiler/testData/psi/packages/PackageSimpleNameLeadingDot.kt create mode 100644 compiler/testData/psi/packages/PackageSimpleNameLeadingDot.txt create mode 100644 compiler/testData/psi/packages/PackageSimpleNameLeadingDoubleDot.kt create mode 100644 compiler/testData/psi/packages/PackageSimpleNameLeadingDoubleDot.txt diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java index 3748f1b3ff0..3f9a45195ac 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java @@ -228,8 +228,16 @@ public class JetParsing extends AbstractJetParsing { break; } + if (at(DOT)) { + advance(); // DOT + qualifiedExpression.error("Package name must be a '.'-separated identifier list"); + qualifiedExpression = mark(); + continue; + } + PsiBuilder.Marker nsName = mark(); - if (expect(IDENTIFIER, "Package name must be a '.'-separated identifier list", PACKAGE_NAME_RECOVERY_SET)) { + boolean simpleNameFound = expect(IDENTIFIER, "Package name must be a '.'-separated identifier list", PACKAGE_NAME_RECOVERY_SET); + if (simpleNameFound) { nsName.done(REFERENCE_EXPRESSION); } else { @@ -243,8 +251,15 @@ public class JetParsing extends AbstractJetParsing { } if (at(DOT)) { - simpleName = false; advance(); // DOT + + if (simpleName && !simpleNameFound) { + qualifiedExpression.drop(); + qualifiedExpression = mark(); + } + else { + simpleName = false; + } } else { break; diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetQualifiedExpressionImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetQualifiedExpressionImpl.kt index a521afc9bcc..4d3a277e203 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetQualifiedExpressionImpl.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetQualifiedExpressionImpl.kt @@ -20,6 +20,7 @@ import com.intellij.lang.ASTNode import org.jetbrains.kotlin.lexer.JetToken import org.jetbrains.kotlin.lexer.JetTokens import com.intellij.psi.util.PsiTreeUtil +import org.jetbrains.kotlin.psi.psiUtil.* object JetQualifiedExpressionImpl { public fun JetQualifiedExpression.getOperationTokenNode(): ASTNode { @@ -31,20 +32,15 @@ object JetQualifiedExpressionImpl { return this.getOperationTokenNode().getElementType() as JetToken } + private fun JetQualifiedExpression.getExpression(afterOperation: Boolean): JetExpression? { + return getOperationTokenNode()?.getPsi()?.siblings(afterOperation, false)?.firstOrNull { it is JetExpression } as? JetExpression + } + public fun JetQualifiedExpression.getReceiverExpression(): JetExpression { - val left = PsiTreeUtil.findChildOfType(this, javaClass()) - return left!! + return getExpression(false) ?: throw AssertionError("No receiver found: ${JetPsiUtil.getElementTextWithContext(this)}") } public fun JetQualifiedExpression.getSelectorExpression(): JetExpression? { - var node: ASTNode? = getOperationTokenNode() - while (node != null) { - val psi = node!!.getPsi() - if (psi is JetExpression) { - return (psi as JetExpression) - } - node = node!!.getTreeNext() - } - return null + return getExpression(true) } } diff --git a/compiler/testData/psi/PackageBlockFirst.kt b/compiler/testData/psi/packages/PackageBlockFirst.kt similarity index 100% rename from compiler/testData/psi/PackageBlockFirst.kt rename to compiler/testData/psi/packages/PackageBlockFirst.kt diff --git a/compiler/testData/psi/PackageBlockFirst.txt b/compiler/testData/psi/packages/PackageBlockFirst.txt similarity index 100% rename from compiler/testData/psi/PackageBlockFirst.txt rename to compiler/testData/psi/packages/PackageBlockFirst.txt diff --git a/compiler/testData/psi/packages/PackageLeadingDotDoubleID.kt b/compiler/testData/psi/packages/PackageLeadingDotDoubleID.kt new file mode 100644 index 00000000000..3a8c1284aa6 --- /dev/null +++ b/compiler/testData/psi/packages/PackageLeadingDotDoubleID.kt @@ -0,0 +1 @@ +package .a b \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageLeadingDotDoubleID.txt b/compiler/testData/psi/packages/PackageLeadingDotDoubleID.txt new file mode 100644 index 00000000000..90d4c371075 --- /dev/null +++ b/compiler/testData/psi/packages/PackageLeadingDotDoubleID.txt @@ -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 + \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageLongNameBetweenDots.kt b/compiler/testData/psi/packages/PackageLongNameBetweenDots.kt new file mode 100644 index 00000000000..39e7a98ad4c --- /dev/null +++ b/compiler/testData/psi/packages/PackageLongNameBetweenDots.kt @@ -0,0 +1 @@ +package .a.b.c. \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageLongNameBetweenDots.txt b/compiler/testData/psi/packages/PackageLongNameBetweenDots.txt new file mode 100644 index 00000000000..c8c89d4fc9c --- /dev/null +++ b/compiler/testData/psi/packages/PackageLongNameBetweenDots.txt @@ -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 + \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageLongNameDoubleID.kt b/compiler/testData/psi/packages/PackageLongNameDoubleID.kt new file mode 100644 index 00000000000..f810d2eefda --- /dev/null +++ b/compiler/testData/psi/packages/PackageLongNameDoubleID.kt @@ -0,0 +1 @@ +package a b \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageLongNameDoubleID.txt b/compiler/testData/psi/packages/PackageLongNameDoubleID.txt new file mode 100644 index 00000000000..a3e2c29c86b --- /dev/null +++ b/compiler/testData/psi/packages/PackageLongNameDoubleID.txt @@ -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 + \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageLongNameLeadingDot.kt b/compiler/testData/psi/packages/PackageLongNameLeadingDot.kt new file mode 100644 index 00000000000..e05a4ffeec7 --- /dev/null +++ b/compiler/testData/psi/packages/PackageLongNameLeadingDot.kt @@ -0,0 +1 @@ +package .a.b.c \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageLongNameLeadingDot.txt b/compiler/testData/psi/packages/PackageLongNameLeadingDot.txt new file mode 100644 index 00000000000..f8473b57bfd --- /dev/null +++ b/compiler/testData/psi/packages/PackageLongNameLeadingDot.txt @@ -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') \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageLongNameLeadingDoubleDot.kt b/compiler/testData/psi/packages/PackageLongNameLeadingDoubleDot.kt new file mode 100644 index 00000000000..8649b872557 --- /dev/null +++ b/compiler/testData/psi/packages/PackageLongNameLeadingDoubleDot.kt @@ -0,0 +1 @@ +package . .a.b.c \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageLongNameLeadingDoubleDot.txt b/compiler/testData/psi/packages/PackageLongNameLeadingDoubleDot.txt new file mode 100644 index 00000000000..c0b601d3a82 --- /dev/null +++ b/compiler/testData/psi/packages/PackageLongNameLeadingDoubleDot.txt @@ -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') \ No newline at end of file diff --git a/compiler/testData/psi/PackageModifiers.kt b/compiler/testData/psi/packages/PackageModifiers.kt similarity index 100% rename from compiler/testData/psi/PackageModifiers.kt rename to compiler/testData/psi/packages/PackageModifiers.kt diff --git a/compiler/testData/psi/PackageModifiers.txt b/compiler/testData/psi/packages/PackageModifiers.txt similarity index 100% rename from compiler/testData/psi/PackageModifiers.txt rename to compiler/testData/psi/packages/PackageModifiers.txt diff --git a/compiler/testData/psi/packages/PackageNameDoubleDot.kt b/compiler/testData/psi/packages/PackageNameDoubleDot.kt new file mode 100644 index 00000000000..2112b09d814 --- /dev/null +++ b/compiler/testData/psi/packages/PackageNameDoubleDot.kt @@ -0,0 +1 @@ +package . . \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageNameDoubleDot.txt b/compiler/testData/psi/packages/PackageNameDoubleDot.txt new file mode 100644 index 00000000000..351a7031a6e --- /dev/null +++ b/compiler/testData/psi/packages/PackageNameDoubleDot.txt @@ -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 + \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageNameJustDot.kt b/compiler/testData/psi/packages/PackageNameJustDot.kt new file mode 100644 index 00000000000..82fe2f93c5c --- /dev/null +++ b/compiler/testData/psi/packages/PackageNameJustDot.kt @@ -0,0 +1 @@ +package . \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageNameJustDot.txt b/compiler/testData/psi/packages/PackageNameJustDot.txt new file mode 100644 index 00000000000..5fc43fcfa75 --- /dev/null +++ b/compiler/testData/psi/packages/PackageNameJustDot.txt @@ -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 + \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageSimpleNameLeadingDot.kt b/compiler/testData/psi/packages/PackageSimpleNameLeadingDot.kt new file mode 100644 index 00000000000..77028b3872c --- /dev/null +++ b/compiler/testData/psi/packages/PackageSimpleNameLeadingDot.kt @@ -0,0 +1 @@ +package .a \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageSimpleNameLeadingDot.txt b/compiler/testData/psi/packages/PackageSimpleNameLeadingDot.txt new file mode 100644 index 00000000000..8158225a2fa --- /dev/null +++ b/compiler/testData/psi/packages/PackageSimpleNameLeadingDot.txt @@ -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') \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageSimpleNameLeadingDoubleDot.kt b/compiler/testData/psi/packages/PackageSimpleNameLeadingDoubleDot.kt new file mode 100644 index 00000000000..d16ee2fb257 --- /dev/null +++ b/compiler/testData/psi/packages/PackageSimpleNameLeadingDoubleDot.kt @@ -0,0 +1 @@ +package . .a \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageSimpleNameLeadingDoubleDot.txt b/compiler/testData/psi/packages/PackageSimpleNameLeadingDoubleDot.txt new file mode 100644 index 00000000000..d84c3d0f30a --- /dev/null +++ b/compiler/testData/psi/packages/PackageSimpleNameLeadingDoubleDot.txt @@ -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') \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java index f53ed5bbe52..94d8313cf5f 100644 --- a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java @@ -43,6 +43,7 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { Psi.FunctionReceivers.class, Psi.GreatSyntacticShift.class, Psi.Kdoc.class, + Psi.Packages.class, Psi.PlatformTypesRecovery.class, Psi.PropertyDelegate.class, Psi.Recovery.class, @@ -433,18 +434,6 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } - @TestMetadata("PackageBlockFirst.kt") - public void testPackageBlockFirst() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/PackageBlockFirst.kt"); - doParsingTest(fileName); - } - - @TestMetadata("PackageModifiers.kt") - public void testPackageModifiers() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/PackageModifiers.kt"); - doParsingTest(fileName); - } - @TestMetadata("ParameterNameMising.kt") public void testParameterNameMising() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/ParameterNameMising.kt"); @@ -1200,6 +1189,81 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { } } + @TestMetadata("compiler/testData/psi/packages") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Packages extends AbstractJetParsingTest { + public void testAllFilesPresentInPackages() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/psi/packages"), Pattern.compile("^(.*)\\.kts?$"), true); + } + + @TestMetadata("PackageBlockFirst.kt") + public void testPackageBlockFirst() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageBlockFirst.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageLeadingDotDoubleID.kt") + public void testPackageLeadingDotDoubleID() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageLeadingDotDoubleID.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageLongNameBetweenDots.kt") + public void testPackageLongNameBetweenDots() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageLongNameBetweenDots.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageLongNameDoubleID.kt") + public void testPackageLongNameDoubleID() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageLongNameDoubleID.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageLongNameLeadingDot.kt") + public void testPackageLongNameLeadingDot() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageLongNameLeadingDot.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageLongNameLeadingDoubleDot.kt") + public void testPackageLongNameLeadingDoubleDot() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageLongNameLeadingDoubleDot.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageModifiers.kt") + public void testPackageModifiers() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageModifiers.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageNameDoubleDot.kt") + public void testPackageNameDoubleDot() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageNameDoubleDot.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageNameJustDot.kt") + public void testPackageNameJustDot() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageNameJustDot.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageSimpleNameLeadingDot.kt") + public void testPackageSimpleNameLeadingDot() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageSimpleNameLeadingDot.kt"); + doParsingTest(fileName); + } + + @TestMetadata("PackageSimpleNameLeadingDoubleDot.kt") + public void testPackageSimpleNameLeadingDoubleDot() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/packages/PackageSimpleNameLeadingDoubleDot.kt"); + doParsingTest(fileName); + } + } + @TestMetadata("compiler/testData/psi/platformTypesRecovery") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)