Minor in Parser: drop obsolete code.

This commit is contained in:
Zalim Bashorov
2014-09-09 16:38:52 +04:00
parent 3c60d0de93
commit fb97b1df93
2 changed files with 4 additions and 23 deletions
@@ -194,20 +194,8 @@ public class JetParsing extends AbstractJetParsing {
if (at(PACKAGE_KEYWORD)) {
advance(); // PACKAGE_KEYWORD
parsePackageName();
if (at(LBRACE)) {
// Because it's blocked package and it will be parsed as one of top level objects
packageDirective.drop();
firstEntry.rollbackTo();
parseFileAnnotationList(/*reportErrorForNonFileAnnotations =*/ false);
packageDirective = mark();
packageDirective.done(PACKAGE_DIRECTIVE);
return;
}
firstEntry.drop();
consumeIf(SEMICOLON);
+4 -11
View File
@@ -1,16 +1,9 @@
JetFile: PackageBlockFirst.kt
PACKAGE_DIRECTIVE
<empty list>
PsiErrorElement:Expecting package directive or top level declaration
PsiElement(package)('package')
PsiWhiteSpace(' ')
MODIFIER_LIST
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foobar')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foobar')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting package directive or top level declaration
PsiElement(LBRACE)('{')
@@ -40,4 +33,4 @@ JetFile: PackageBlockFirst.kt
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n')
PsiErrorElement:Expecting package directive or top level declaration
PsiElement(RBRACE)('}')
PsiElement(RBRACE)('}')