diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/CommentBinders.kt b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/CommentBinders.kt index ab2c0f8e132..258eda49405 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/CommentBinders.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/CommentBinders.kt @@ -40,6 +40,7 @@ object PrecedingWhitespacesAndCommentsBinder : WhitespacesAndCommentsBinder { } else if (tokenType in JetTokens.COMMENTS && tokenType != JetTokens.DOC_COMMENT) { if (atStreamEdge || + idx == 0 || idx > 0 && tokens[idx - 1] == JetTokens.WHITE_SPACE && StringUtil.containsLineBreak(getter[idx - 1])) { result = idx } 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 36db3998ac0..f770ffb3423 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java @@ -199,6 +199,9 @@ public class JetParsing extends AbstractJetParsing { firstEntry.drop(); consumeIf(SEMICOLON); + + packageDirective.done(PACKAGE_DIRECTIVE); + packageDirective.setCustomEdgeTokenBinders(null, TrailingWhitespacesAndCommentsBinder.INSTANCE$); } else { // When package directive is omitted we should not report error on non-file annotations at the beginning of the file. @@ -207,9 +210,10 @@ public class JetParsing extends AbstractJetParsing { parseFileAnnotationList(FILE_ANNOTATIONS_WHEN_PACKAGE_OMITTED); packageDirective = mark(); + packageDirective.done(PACKAGE_DIRECTIVE); + // this is necessary to allow comments at the start of the file to be bound to the first declaration: + packageDirective.setCustomEdgeTokenBinders(PrecedingWhitespacesAndCommentsBinder.INSTANCE$, null); } - packageDirective.done(PACKAGE_DIRECTIVE); - packageDirective.setCustomEdgeTokenBinders(null, TrailingWhitespacesAndCommentsBinder.INSTANCE$); parseImportDirectives(); } @@ -706,8 +710,6 @@ public class JetParsing extends AbstractJetParsing { PsiBuilder.Marker nameAsDeclaration = mark(); advance(); // IDENTIFIER nameAsDeclaration.done(OBJECT_DECLARATION_NAME); - nameAsDeclaration.setCustomEdgeTokenBinders(PrecedingWhitespacesAndCommentsBinder.INSTANCE$, - TrailingWhitespacesAndCommentsBinder.INSTANCE$); if (at(COLON)) { advance(); // COLON diff --git a/compiler/testData/psi/BlockCommentAtBeginningOfFile1.txt b/compiler/testData/psi/BlockCommentAtBeginningOfFile1.txt index df5879d4084..c890392c91f 100644 --- a/compiler/testData/psi/BlockCommentAtBeginningOfFile1.txt +++ b/compiler/testData/psi/BlockCommentAtBeginningOfFile1.txt @@ -1,4 +1,4 @@ JetFile: BlockCommentAtBeginningOfFile1.kt - PsiComment(BLOCK_COMMENT)('/*') PACKAGE_DIRECTIVE - \ No newline at end of file + + PsiComment(BLOCK_COMMENT)('/*') \ No newline at end of file diff --git a/compiler/testData/psi/BlockCommentAtBeginningOfFile2.txt b/compiler/testData/psi/BlockCommentAtBeginningOfFile2.txt index be9651d0c02..cbb897d7d6d 100644 --- a/compiler/testData/psi/BlockCommentAtBeginningOfFile2.txt +++ b/compiler/testData/psi/BlockCommentAtBeginningOfFile2.txt @@ -1,4 +1,4 @@ JetFile: BlockCommentAtBeginningOfFile2.kt - PsiComment(BLOCK_COMMENT)('/*\n/*') PACKAGE_DIRECTIVE - \ No newline at end of file + + PsiComment(BLOCK_COMMENT)('/*\n/*') \ No newline at end of file diff --git a/compiler/testData/psi/BlockCommentAtBeginningOfFile3.txt b/compiler/testData/psi/BlockCommentAtBeginningOfFile3.txt index 049a01d5632..dbfc5417f81 100644 --- a/compiler/testData/psi/BlockCommentAtBeginningOfFile3.txt +++ b/compiler/testData/psi/BlockCommentAtBeginningOfFile3.txt @@ -1,4 +1,4 @@ JetFile: BlockCommentAtBeginningOfFile3.kt - PsiComment(BLOCK_COMMENT)('/*\n\nfooo') PACKAGE_DIRECTIVE - \ No newline at end of file + + PsiComment(BLOCK_COMMENT)('/*\n\nfooo') \ No newline at end of file diff --git a/compiler/testData/psi/BlockCommentAtBeginningOfFile4.txt b/compiler/testData/psi/BlockCommentAtBeginningOfFile4.txt index d50728c9383..78398ef74ea 100644 --- a/compiler/testData/psi/BlockCommentAtBeginningOfFile4.txt +++ b/compiler/testData/psi/BlockCommentAtBeginningOfFile4.txt @@ -1,4 +1,4 @@ JetFile: BlockCommentAtBeginningOfFile4.kt - PsiComment(BLOCK_COMMENT)('/*\n\n/*foo*/\n\nasdfas') PACKAGE_DIRECTIVE - \ No newline at end of file + + PsiComment(BLOCK_COMMENT)('/*\n\n/*foo*/\n\nasdfas') \ No newline at end of file diff --git a/compiler/testData/psi/CommentsBinding.txt b/compiler/testData/psi/CommentsBinding.txt index 19fad077896..b342b681413 100644 --- a/compiler/testData/psi/CommentsBinding.txt +++ b/compiler/testData/psi/CommentsBinding.txt @@ -269,16 +269,16 @@ JetFile: CommentsBinding.kt ENUM_ENTRY OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('A') - PsiWhiteSpace(' ') - PsiComment(EOL_COMMENT)('// this is A') + PsiWhiteSpace(' ') + PsiComment(EOL_COMMENT)('// this is A') PsiWhiteSpace('\n ') ENUM_ENTRY + KDoc + PsiElement(KDOC_START)('/**') + PsiElement(KDOC_TEXT)(' This is B ') + PsiElement(KDOC_END)('*/') + PsiWhiteSpace(' ') OBJECT_DECLARATION_NAME - KDoc - PsiElement(KDOC_START)('/**') - PsiElement(KDOC_TEXT)(' This is B ') - PsiElement(KDOC_END)('*/') - PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('B') PsiWhiteSpace('\n ') ENUM_ENTRY @@ -288,12 +288,12 @@ JetFile: CommentsBinding.kt PsiElement(IDENTIFIER)('C') PsiWhiteSpace('\n ') ENUM_ENTRY + KDoc + PsiElement(KDOC_START)('/**') + PsiElement(KDOC_TEXT)(' This is X ') + PsiElement(KDOC_END)('*/') + PsiWhiteSpace('\n ') OBJECT_DECLARATION_NAME - KDoc - PsiElement(KDOC_START)('/**') - PsiElement(KDOC_TEXT)(' This is X ') - PsiElement(KDOC_END)('*/') - PsiWhiteSpace('\n ') PsiElement(IDENTIFIER)('X') PsiWhiteSpace(' ') CLASS_BODY diff --git a/compiler/testData/psi/DocCommentAfterFileAnnotations.kt b/compiler/testData/psi/DocCommentAfterFileAnnotations.kt new file mode 100644 index 00000000000..24047353950 --- /dev/null +++ b/compiler/testData/psi/DocCommentAfterFileAnnotations.kt @@ -0,0 +1,5 @@ +[file:volatile] +/** + * Doc comment + */ +class C{} \ No newline at end of file diff --git a/compiler/testData/psi/DocCommentAfterFileAnnotations.txt b/compiler/testData/psi/DocCommentAfterFileAnnotations.txt new file mode 100644 index 00000000000..b5cc56c9605 --- /dev/null +++ b/compiler/testData/psi/DocCommentAfterFileAnnotations.txt @@ -0,0 +1,31 @@ +JetFile: DocCommentAfterFileAnnotations.kt + FILE_ANNOTATION_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + PsiElement(file)('file') + PsiElement(COLON)(':') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('volatile') + PsiElement(RBRACKET)(']') + PsiWhiteSpace('\n') + PACKAGE_DIRECTIVE + + CLASS + KDoc + PsiElement(KDOC_START)('/**') + PsiWhiteSpace('\n ') + PsiElement(KDOC_LEADING_ASTERISK)('*') + PsiElement(KDOC_TEXT)(' Doc comment') + PsiWhiteSpace('\n ') + PsiElement(KDOC_END)('*/') + PsiWhiteSpace('\n') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('C') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/DocCommentForFirstDeclaration.kt b/compiler/testData/psi/DocCommentForFirstDeclaration.kt new file mode 100644 index 00000000000..e2fe5250b03 --- /dev/null +++ b/compiler/testData/psi/DocCommentForFirstDeclaration.kt @@ -0,0 +1,4 @@ +/** + * Doc comment + */ +fun foo() {} \ No newline at end of file diff --git a/compiler/testData/psi/DocCommentForFirstDeclaration.txt b/compiler/testData/psi/DocCommentForFirstDeclaration.txt new file mode 100644 index 00000000000..58db3ebfed5 --- /dev/null +++ b/compiler/testData/psi/DocCommentForFirstDeclaration.txt @@ -0,0 +1,22 @@ +JetFile: DocCommentForFirstDeclaration.kt + PACKAGE_DIRECTIVE + + FUN + KDoc + PsiElement(KDOC_START)('/**') + PsiWhiteSpace('\n ') + PsiElement(KDOC_LEADING_ASTERISK)('*') + PsiElement(KDOC_TEXT)(' Doc comment') + PsiWhiteSpace('\n ') + PsiElement(KDOC_END)('*/') + PsiWhiteSpace('\n') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/LineCommentAfterFileAnnotations.kt b/compiler/testData/psi/LineCommentAfterFileAnnotations.kt new file mode 100644 index 00000000000..74240d85be7 --- /dev/null +++ b/compiler/testData/psi/LineCommentAfterFileAnnotations.kt @@ -0,0 +1,3 @@ +[file:volatile] +// class C +class C{} \ No newline at end of file diff --git a/compiler/testData/psi/LineCommentAfterFileAnnotations.txt b/compiler/testData/psi/LineCommentAfterFileAnnotations.txt new file mode 100644 index 00000000000..0563535c3e8 --- /dev/null +++ b/compiler/testData/psi/LineCommentAfterFileAnnotations.txt @@ -0,0 +1,25 @@ +JetFile: LineCommentAfterFileAnnotations.kt + FILE_ANNOTATION_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + PsiElement(file)('file') + PsiElement(COLON)(':') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('volatile') + PsiElement(RBRACKET)(']') + PsiWhiteSpace('\n') + PACKAGE_DIRECTIVE + + CLASS + PsiComment(EOL_COMMENT)('// class C') + PsiWhiteSpace('\n') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('C') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/LineCommentForFirstDeclaration.kt b/compiler/testData/psi/LineCommentForFirstDeclaration.kt new file mode 100644 index 00000000000..6760855fc1c --- /dev/null +++ b/compiler/testData/psi/LineCommentForFirstDeclaration.kt @@ -0,0 +1,2 @@ +// This is foo +fun foo() {} \ No newline at end of file diff --git a/compiler/testData/psi/LineCommentForFirstDeclaration.txt b/compiler/testData/psi/LineCommentForFirstDeclaration.txt new file mode 100644 index 00000000000..ce474d31813 --- /dev/null +++ b/compiler/testData/psi/LineCommentForFirstDeclaration.txt @@ -0,0 +1,16 @@ +JetFile: LineCommentForFirstDeclaration.kt + PACKAGE_DIRECTIVE + + FUN + PsiComment(EOL_COMMENT)('// This is foo') + PsiWhiteSpace('\n') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/Super.txt b/compiler/testData/psi/Super.txt index db9dab7aab0..7f1a6066b3c 100644 --- a/compiler/testData/psi/Super.txt +++ b/compiler/testData/psi/Super.txt @@ -1,9 +1,9 @@ JetFile: Super.kt - PsiComment(EOL_COMMENT)('// KT-156 Fix the this syntax') - PsiWhiteSpace('\n') PACKAGE_DIRECTIVE FUN + PsiComment(EOL_COMMENT)('// KT-156 Fix the this syntax') + PsiWhiteSpace('\n') PsiElement(fun)('fun') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/examples/array/MutableArray.txt b/compiler/testData/psi/examples/array/MutableArray.txt index aae90cd6700..928e7874a03 100644 --- a/compiler/testData/psi/examples/array/MutableArray.txt +++ b/compiler/testData/psi/examples/array/MutableArray.txt @@ -1,14 +1,14 @@ JetFile: MutableArray.kt - KDoc - PsiElement(KDOC_START)('/**') - PsiWhiteSpace('\n ') - PsiElement(KDOC_TEXT)('These declarations are "shallow" in the sense that they are not really compiled, only the type-checker uses them') - PsiWhiteSpace('\n') - PsiElement(KDOC_END)('*/') - PsiWhiteSpace('\n\n') PACKAGE_DIRECTIVE CLASS + KDoc + PsiElement(KDOC_START)('/**') + PsiWhiteSpace('\n ') + PsiElement(KDOC_TEXT)('These declarations are "shallow" in the sense that they are not really compiled, only the type-checker uses them') + PsiWhiteSpace('\n') + PsiElement(KDOC_END)('*/') + PsiWhiteSpace('\n\n') MODIFIER_LIST PsiElement(open)('open') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/kdoc/AtTags.txt b/compiler/testData/psi/kdoc/AtTags.txt index dc947919a77..7a890defcbe 100644 --- a/compiler/testData/psi/kdoc/AtTags.txt +++ b/compiler/testData/psi/kdoc/AtTags.txt @@ -1,4 +1,6 @@ JetFile: AtTags.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n ') @@ -12,6 +14,4 @@ JetFile: AtTags.kt PsiElement(KDOC_LEADING_ASTERISK)('*') PsiElement(KDOC_TEXT)(' @') PsiWhiteSpace('\n ') - PsiElement(KDOC_END)('*/') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_END)('*/') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile1.txt b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile1.txt index 357f480c612..cf6ca9c30f0 100644 --- a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile1.txt +++ b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile1.txt @@ -1,5 +1,5 @@ JetFile: DocCommentAtBeginningOfFile1.kt - KDoc - PsiElement(KDOC_START)('/**') PACKAGE_DIRECTIVE - \ No newline at end of file + + KDoc + PsiElement(KDOC_START)('/**') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile2.txt b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile2.txt index e7d60df0edc..c497cb3aa3b 100644 --- a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile2.txt +++ b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile2.txt @@ -1,7 +1,7 @@ JetFile: DocCommentAtBeginningOfFile2.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n') - PsiElement(KDOC_TEXT)('/**') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_TEXT)('/**') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile3.txt b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile3.txt index 93c8b5aa595..a0b7c9e63db 100644 --- a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile3.txt +++ b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile3.txt @@ -1,7 +1,7 @@ JetFile: DocCommentAtBeginningOfFile3.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n\n') - PsiElement(KDOC_TEXT)('fooo') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_TEXT)('fooo') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile4.txt b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile4.txt index b1303e6322c..d882da21f3a 100644 --- a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile4.txt +++ b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile4.txt @@ -1,9 +1,9 @@ JetFile: DocCommentAtBeginningOfFile4.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n\n') PsiElement(KDOC_TEXT)('/**foo*/') PsiWhiteSpace('\n\n') - PsiElement(KDOC_TEXT)('asdfas') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_TEXT)('asdfas') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/EndOnLeadingAsterisks.txt b/compiler/testData/psi/kdoc/EndOnLeadingAsterisks.txt index 01df82cf050..ac62c23340c 100644 --- a/compiler/testData/psi/kdoc/EndOnLeadingAsterisks.txt +++ b/compiler/testData/psi/kdoc/EndOnLeadingAsterisks.txt @@ -1,7 +1,7 @@ JetFile: EndOnLeadingAsterisks.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n ') - PsiElement(KDOC_END)('*/') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_END)('*/') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/EndRightAfterText.txt b/compiler/testData/psi/kdoc/EndRightAfterText.txt index a4388e32dc6..15dca239106 100644 --- a/compiler/testData/psi/kdoc/EndRightAfterText.txt +++ b/compiler/testData/psi/kdoc/EndRightAfterText.txt @@ -1,7 +1,7 @@ JetFile: EndRightAfterText.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiElement(KDOC_TEXT)('text') - PsiElement(KDOC_END)('*/') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_END)('*/') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/Incomplete.txt b/compiler/testData/psi/kdoc/Incomplete.txt index 63a3269e7bf..b16a862297e 100644 --- a/compiler/testData/psi/kdoc/Incomplete.txt +++ b/compiler/testData/psi/kdoc/Incomplete.txt @@ -1,7 +1,7 @@ JetFile: Incomplete.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n ') - PsiElement(KDOC_TEXT)('contents') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_TEXT)('contents') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/Markdown.txt b/compiler/testData/psi/kdoc/Markdown.txt index e6b4fae5eba..c98b39a27d5 100644 --- a/compiler/testData/psi/kdoc/Markdown.txt +++ b/compiler/testData/psi/kdoc/Markdown.txt @@ -1,4 +1,6 @@ JetFile: Markdown.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n ') @@ -15,6 +17,4 @@ JetFile: Markdown.kt PsiElement(KDOC_MARKDOWN_ESCAPED_CHAR)('\]') PsiElement(KDOC_TEXT)(']') PsiWhiteSpace('\n ') - PsiElement(KDOC_END)('*/') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_END)('*/') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/Simple.txt b/compiler/testData/psi/kdoc/Simple.txt index 81eeb7b235d..1661f7c3fb5 100644 --- a/compiler/testData/psi/kdoc/Simple.txt +++ b/compiler/testData/psi/kdoc/Simple.txt @@ -1,4 +1,6 @@ JetFile: Simple.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiElement(KDOC_TEXT)(' line 0') @@ -18,6 +20,4 @@ JetFile: Simple.kt PsiWhiteSpace('\n ') PsiElement(KDOC_LEADING_ASTERISK)('**') PsiElement(KDOC_TEXT)(' line 6 ') - PsiElement(KDOC_END)('*/') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_END)('*/') \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/TextRightAfterLeadAsterisks.txt b/compiler/testData/psi/kdoc/TextRightAfterLeadAsterisks.txt index 86dad80bcf4..1f8ac66cb20 100644 --- a/compiler/testData/psi/kdoc/TextRightAfterLeadAsterisks.txt +++ b/compiler/testData/psi/kdoc/TextRightAfterLeadAsterisks.txt @@ -1,10 +1,10 @@ JetFile: TextRightAfterLeadAsterisks.kt + PACKAGE_DIRECTIVE + KDoc PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n') PsiElement(KDOC_LEADING_ASTERISK)('**') PsiElement(KDOC_TEXT)('test') PsiWhiteSpace('\n ') - PsiElement(KDOC_END)('*/') - PACKAGE_DIRECTIVE - \ No newline at end of file + PsiElement(KDOC_END)('*/') \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/parsing/JetParsingTestGenerated.java b/compiler/tests/org/jetbrains/jet/parsing/JetParsingTestGenerated.java index 190000231a6..b7665d6774a 100644 --- a/compiler/tests/org/jetbrains/jet/parsing/JetParsingTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/parsing/JetParsingTestGenerated.java @@ -136,6 +136,18 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } + @TestMetadata("DocCommentAfterFileAnnotations.kt") + public void testDocCommentAfterFileAnnotations() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/DocCommentAfterFileAnnotations.kt"); + doParsingTest(fileName); + } + + @TestMetadata("DocCommentForFirstDeclaration.kt") + public void testDocCommentForFirstDeclaration() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/DocCommentForFirstDeclaration.kt"); + doParsingTest(fileName); + } + @TestMetadata("DoubleColon.kt") public void testDoubleColon() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/DoubleColon.kt"); @@ -292,6 +304,18 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } + @TestMetadata("LineCommentAfterFileAnnotations.kt") + public void testLineCommentAfterFileAnnotations() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/LineCommentAfterFileAnnotations.kt"); + doParsingTest(fileName); + } + + @TestMetadata("LineCommentForFirstDeclaration.kt") + public void testLineCommentForFirstDeclaration() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/LineCommentForFirstDeclaration.kt"); + doParsingTest(fileName); + } + @TestMetadata("LocalDeclarations.kt") public void testLocalDeclarations() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/LocalDeclarations.kt");