diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java index 6e9e4295c52..72bf900a8a8 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java @@ -128,7 +128,7 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing { TokenSet.create(EOL_OR_SEMICOLON)); /*package*/ static final TokenSet EXPRESSION_FOLLOW = TokenSet.create( - SEMICOLON, ARROW, COMMA, RBRACE, RPAR, RBRACKET + EOL_OR_SEMICOLON, ARROW, COMMA, RBRACE, RPAR, RBRACKET ); @SuppressWarnings({"UnusedDeclaration"}) diff --git a/compiler/testData/psi/script/ShebangIncorrect.txt b/compiler/testData/psi/script/ShebangIncorrect.txt index 5ead0e16487..498fcd71f83 100644 --- a/compiler/testData/psi/script/ShebangIncorrect.txt +++ b/compiler/testData/psi/script/ShebangIncorrect.txt @@ -28,10 +28,19 @@ JetFile: ShebangIncorrect.kts PsiElement(DIV)('/') OPERATION_REFERENCE PsiElement(IDENTIFIER)('usr') - PsiWhiteSpace('\n\n') PsiErrorElement:Expecting an element - PsiElement(HASH)('#') - PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) - PsiElement(EXCL)('!') - PsiElement(DIV)('/') - PsiElement(IDENTIFIER)('hi') \ No newline at end of file + + PsiWhiteSpace('\n\n') + PsiErrorElement:Expecting an element + PsiElement(HASH)('#') + SCRIPT_INITIALIZER + BINARY_EXPRESSION + PREFIX_EXPRESSION + OPERATION_REFERENCE + PsiElement(EXCL)('!') + PsiErrorElement:Expecting an element + PsiElement(DIV)('/') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('hi') + PsiErrorElement:Expecting an element +