diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java index 36c82d5d465..58f748f1e05 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java @@ -222,7 +222,7 @@ public class JetParsing extends AbstractJetParsing { /* * import - * : "import" ("namespace" ".")? SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI? + * : "import" SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI? * ; */ private void parseImportDirective() { @@ -231,10 +231,6 @@ public class JetParsing extends AbstractJetParsing { advance(); // IMPORT_KEYWORD PsiBuilder.Marker qualifiedName = mark(); - if (at(PACKAGE_KEYWORD)) { - advance(); // PACKAGE_KEYWORD - expect(DOT, "Expecting '.'", TokenSet.create(IDENTIFIER, MUL, SEMICOLON)); - } PsiBuilder.Marker reference = mark(); expect(IDENTIFIER, "Expecting qualified name"); diff --git a/compiler/testData/psi/Imports.kt b/compiler/testData/psi/Imports.kt index c808898ab53..625c277aa08 100644 --- a/compiler/testData/psi/Imports.kt +++ b/compiler/testData/psi/Imports.kt @@ -1,6 +1,5 @@ package foo.bar.goo -import package.foo import foo import foo.bar import foo as bar diff --git a/compiler/testData/psi/Imports.txt b/compiler/testData/psi/Imports.txt index 47b104ff320..8c268e514c1 100644 --- a/compiler/testData/psi/Imports.txt +++ b/compiler/testData/psi/Imports.txt @@ -11,14 +11,6 @@ JetFile: Imports.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('goo') PsiWhiteSpace('\n\n') - IMPORT_DIRECTIVE - PsiElement(import)('import') - PsiWhiteSpace(' ') - PsiElement(package)('package') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n') IMPORT_DIRECTIVE PsiElement(import)('import') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/Imports_ERR.kt b/compiler/testData/psi/Imports_ERR.kt index 32df24ac58b..e099fbc0e72 100644 --- a/compiler/testData/psi/Imports_ERR.kt +++ b/compiler/testData/psi/Imports_ERR.kt @@ -1,9 +1,5 @@ package foo.bar.goo -import package ; -import package.* -import package. ; - import foo as import foo. import foo.bar. diff --git a/compiler/testData/psi/Imports_ERR.txt b/compiler/testData/psi/Imports_ERR.txt index c2b36dd389c..d7c6c257854 100644 --- a/compiler/testData/psi/Imports_ERR.txt +++ b/compiler/testData/psi/Imports_ERR.txt @@ -11,40 +11,6 @@ JetFile: Imports_ERR.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('goo') PsiWhiteSpace('\n\n') - IMPORT_DIRECTIVE - PsiElement(import)('import') - PsiWhiteSpace(' ') - PsiElement(package)('package') - PsiErrorElement:Expecting '.' - - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiErrorElement:Expecting qualified name - - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n') - IMPORT_DIRECTIVE - PsiElement(import)('import') - PsiWhiteSpace(' ') - PsiElement(package)('package') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiErrorElement:Expecting qualified name - - PsiErrorElement:Expecting package directive or top level declaration - PsiElement(MUL)('*') - PsiWhiteSpace('\n') - IMPORT_DIRECTIVE - PsiElement(import)('import') - PsiWhiteSpace(' ') - PsiElement(package)('package') - PsiElement(DOT)('.') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiErrorElement:Expecting qualified name - - PsiElement(SEMICOLON)(';') - PsiWhiteSpace('\n\n') IMPORT_DIRECTIVE PsiElement(import)('import') PsiWhiteSpace(' ') diff --git a/grammar/src/toplevel.grm b/grammar/src/toplevel.grm index 4f193f05fab..f9f244eb77b 100644 --- a/grammar/src/toplevel.grm +++ b/grammar/src/toplevel.grm @@ -24,7 +24,7 @@ packageHeader ; import - : "import" ("package" ".")? SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI? + : "import" SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI? ; /**