From fb97b1df932605413818ef23f9ab8b2c6272bb12 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Tue, 9 Sep 2014 16:38:52 +0400 Subject: [PATCH] Minor in Parser: drop obsolete code. --- .../jetbrains/jet/lang/parsing/JetParsing.java | 12 ------------ compiler/testData/psi/PackageBlockFirst.txt | 15 ++++----------- 2 files changed, 4 insertions(+), 23 deletions(-) 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 4eb10f5cd02..ac1b04c0748 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java @@ -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); diff --git a/compiler/testData/psi/PackageBlockFirst.txt b/compiler/testData/psi/PackageBlockFirst.txt index b01c659dc87..6d74cfd413a 100644 --- a/compiler/testData/psi/PackageBlockFirst.txt +++ b/compiler/testData/psi/PackageBlockFirst.txt @@ -1,16 +1,9 @@ JetFile: PackageBlockFirst.kt PACKAGE_DIRECTIVE - - 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)('}') \ No newline at end of file + PsiElement(RBRACE)('}')