Remove package prefix from imports
This commit is contained in:
@@ -222,7 +222,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* import
|
* import
|
||||||
* : "import" ("namespace" ".")? SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI?
|
* : "import" SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI?
|
||||||
* ;
|
* ;
|
||||||
*/
|
*/
|
||||||
private void parseImportDirective() {
|
private void parseImportDirective() {
|
||||||
@@ -231,10 +231,6 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
advance(); // IMPORT_KEYWORD
|
advance(); // IMPORT_KEYWORD
|
||||||
|
|
||||||
PsiBuilder.Marker qualifiedName = mark();
|
PsiBuilder.Marker qualifiedName = mark();
|
||||||
if (at(PACKAGE_KEYWORD)) {
|
|
||||||
advance(); // PACKAGE_KEYWORD
|
|
||||||
expect(DOT, "Expecting '.'", TokenSet.create(IDENTIFIER, MUL, SEMICOLON));
|
|
||||||
}
|
|
||||||
|
|
||||||
PsiBuilder.Marker reference = mark();
|
PsiBuilder.Marker reference = mark();
|
||||||
expect(IDENTIFIER, "Expecting qualified name");
|
expect(IDENTIFIER, "Expecting qualified name");
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package foo.bar.goo
|
package foo.bar.goo
|
||||||
|
|
||||||
import package.foo
|
|
||||||
import foo
|
import foo
|
||||||
import foo.bar
|
import foo.bar
|
||||||
import foo as bar
|
import foo as bar
|
||||||
|
|||||||
@@ -11,14 +11,6 @@ JetFile: Imports.kt
|
|||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('goo')
|
PsiElement(IDENTIFIER)('goo')
|
||||||
PsiWhiteSpace('\n\n')
|
PsiWhiteSpace('\n\n')
|
||||||
IMPORT_DIRECTIVE
|
|
||||||
PsiElement(import)('import')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
PsiElement(package)('package')
|
|
||||||
PsiElement(DOT)('.')
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiElement(IDENTIFIER)('foo')
|
|
||||||
PsiWhiteSpace('\n')
|
|
||||||
IMPORT_DIRECTIVE
|
IMPORT_DIRECTIVE
|
||||||
PsiElement(import)('import')
|
PsiElement(import)('import')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
package foo.bar.goo
|
package foo.bar.goo
|
||||||
|
|
||||||
import package ;
|
|
||||||
import package.*
|
|
||||||
import package. ;
|
|
||||||
|
|
||||||
import foo as
|
import foo as
|
||||||
import foo.
|
import foo.
|
||||||
import foo.bar.
|
import foo.bar.
|
||||||
|
|||||||
@@ -11,40 +11,6 @@ JetFile: Imports_ERR.kt
|
|||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('goo')
|
PsiElement(IDENTIFIER)('goo')
|
||||||
PsiWhiteSpace('\n\n')
|
PsiWhiteSpace('\n\n')
|
||||||
IMPORT_DIRECTIVE
|
|
||||||
PsiElement(import)('import')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
PsiElement(package)('package')
|
|
||||||
PsiErrorElement:Expecting '.'
|
|
||||||
<empty list>
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiErrorElement:Expecting qualified name
|
|
||||||
<empty list>
|
|
||||||
PsiElement(SEMICOLON)(';')
|
|
||||||
PsiWhiteSpace('\n')
|
|
||||||
IMPORT_DIRECTIVE
|
|
||||||
PsiElement(import)('import')
|
|
||||||
PsiWhiteSpace(' ')
|
|
||||||
PsiElement(package)('package')
|
|
||||||
PsiElement(DOT)('.')
|
|
||||||
REFERENCE_EXPRESSION
|
|
||||||
PsiErrorElement:Expecting qualified name
|
|
||||||
<empty list>
|
|
||||||
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
|
|
||||||
<empty list>
|
|
||||||
PsiElement(SEMICOLON)(';')
|
|
||||||
PsiWhiteSpace('\n\n')
|
|
||||||
IMPORT_DIRECTIVE
|
IMPORT_DIRECTIVE
|
||||||
PsiElement(import)('import')
|
PsiElement(import)('import')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ packageHeader
|
|||||||
;
|
;
|
||||||
|
|
||||||
import
|
import
|
||||||
: "import" ("package" ".")? SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI?
|
: "import" SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI?
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user