From dd91727a781f4bd106e8f42d13e95359914c3bcc Mon Sep 17 00:00:00 2001 From: "victor.petukhov" Date: Tue, 25 Sep 2018 13:04:56 +0300 Subject: [PATCH] Add generated PSI tests for Boolean literals as identifiers --- .../boolean-literals/p-1/neg/2.1.kt | 20 + .../boolean-literals/p-1/neg/2.1.txt | 98 ++++ .../boolean-literals/p-1/neg/2.10.kt | 28 ++ .../boolean-literals/p-1/neg/2.10.txt | 119 +++++ .../boolean-literals/p-1/neg/2.11.kt | 16 + .../boolean-literals/p-1/neg/2.11.txt | 62 +++ .../boolean-literals/p-1/neg/2.12.kt | 25 ++ .../boolean-literals/p-1/neg/2.12.txt | 111 +++++ .../boolean-literals/p-1/neg/2.13.kt | 18 + .../boolean-literals/p-1/neg/2.13.txt | 134 ++++++ .../boolean-literals/p-1/neg/2.14.kt | 24 + .../boolean-literals/p-1/neg/2.14.txt | 246 ++++++++++ .../boolean-literals/p-1/neg/2.15.kt | 23 + .../boolean-literals/p-1/neg/2.15.txt | 179 ++++++++ .../boolean-literals/p-1/neg/2.16.kt | 12 + .../boolean-literals/p-1/neg/2.16.txt | 36 ++ .../boolean-literals/p-1/neg/2.17.kt | 18 + .../boolean-literals/p-1/neg/2.17.txt | 109 +++++ .../boolean-literals/p-1/neg/2.18.kt | 16 + .../boolean-literals/p-1/neg/2.18.txt | 95 ++++ .../boolean-literals/p-1/neg/2.19.kt | 20 + .../boolean-literals/p-1/neg/2.19.txt | 65 +++ .../boolean-literals/p-1/neg/2.2.kt | 19 + .../boolean-literals/p-1/neg/2.2.txt | 57 +++ .../boolean-literals/p-1/neg/2.20.kt | 16 + .../boolean-literals/p-1/neg/2.20.txt | 68 +++ .../boolean-literals/p-1/neg/2.21.kt | 16 + .../boolean-literals/p-1/neg/2.21.txt | 80 ++++ .../boolean-literals/p-1/neg/2.22.kt | 32 ++ .../boolean-literals/p-1/neg/2.22.txt | 400 +++++++++++++++++ .../boolean-literals/p-1/neg/2.23.kt | 20 + .../boolean-literals/p-1/neg/2.23.txt | 151 +++++++ .../boolean-literals/p-1/neg/2.24.kt | 26 ++ .../boolean-literals/p-1/neg/2.24.txt | 158 +++++++ .../boolean-literals/p-1/neg/2.25.kt | 22 + .../boolean-literals/p-1/neg/2.25.txt | 142 ++++++ .../boolean-literals/p-1/neg/2.26.kt | 18 + .../boolean-literals/p-1/neg/2.26.txt | 80 ++++ .../boolean-literals/p-1/neg/2.3.kt | 27 ++ .../boolean-literals/p-1/neg/2.3.txt | 322 ++++++++++++++ .../boolean-literals/p-1/neg/2.4.kt | 12 + .../boolean-literals/p-1/neg/2.4.txt | 12 + .../boolean-literals/p-1/neg/2.5.kt | 12 + .../boolean-literals/p-1/neg/2.5.txt | 16 + .../boolean-literals/p-1/neg/2.6.kt | 12 + .../boolean-literals/p-1/neg/2.6.txt | 8 + .../boolean-literals/p-1/neg/2.7.kt | 15 + .../boolean-literals/p-1/neg/2.7.txt | 62 +++ .../boolean-literals/p-1/neg/2.8.kt | 18 + .../boolean-literals/p-1/neg/2.8.txt | 94 ++++ .../boolean-literals/p-1/neg/2.9.kt | 33 ++ .../boolean-literals/p-1/neg/2.9.txt | 311 +++++++++++++ .../boolean-literals/p-1/pos/2.1.kt | 20 + .../boolean-literals/p-1/pos/2.1.txt | 99 ++++ .../boolean-literals/p-1/pos/2.10.kt | 28 ++ .../boolean-literals/p-1/pos/2.10.txt | 116 +++++ .../boolean-literals/p-1/pos/2.11.kt | 16 + .../boolean-literals/p-1/pos/2.11.txt | 59 +++ .../boolean-literals/p-1/pos/2.12.kt | 25 ++ .../boolean-literals/p-1/pos/2.12.txt | 108 +++++ .../boolean-literals/p-1/pos/2.13.kt | 18 + .../boolean-literals/p-1/pos/2.13.txt | 121 +++++ .../boolean-literals/p-1/pos/2.14.kt | 24 + .../boolean-literals/p-1/pos/2.14.txt | 241 ++++++++++ .../boolean-literals/p-1/pos/2.15.kt | 23 + .../boolean-literals/p-1/pos/2.15.txt | 172 +++++++ .../boolean-literals/p-1/pos/2.16.kt | 12 + .../boolean-literals/p-1/pos/2.16.txt | 34 ++ .../boolean-literals/p-1/pos/2.17.kt | 18 + .../boolean-literals/p-1/pos/2.17.txt | 111 +++++ .../boolean-literals/p-1/pos/2.18.kt | 16 + .../boolean-literals/p-1/pos/2.18.txt | 95 ++++ .../boolean-literals/p-1/pos/2.19.kt | 20 + .../boolean-literals/p-1/pos/2.19.txt | 66 +++ .../boolean-literals/p-1/pos/2.2.kt | 19 + .../boolean-literals/p-1/pos/2.2.txt | 53 +++ .../boolean-literals/p-1/pos/2.20.kt | 16 + .../boolean-literals/p-1/pos/2.20.txt | 83 ++++ .../boolean-literals/p-1/pos/2.21.kt | 16 + .../boolean-literals/p-1/pos/2.21.txt | 78 ++++ .../boolean-literals/p-1/pos/2.22.kt | 32 ++ .../boolean-literals/p-1/pos/2.22.txt | 421 ++++++++++++++++++ .../boolean-literals/p-1/pos/2.23.kt | 20 + .../boolean-literals/p-1/pos/2.23.txt | 149 +++++++ .../boolean-literals/p-1/pos/2.24.kt | 26 ++ .../boolean-literals/p-1/pos/2.24.txt | 166 +++++++ .../boolean-literals/p-1/pos/2.25.kt | 22 + .../boolean-literals/p-1/pos/2.25.txt | 137 ++++++ .../boolean-literals/p-1/pos/2.26.kt | 18 + .../boolean-literals/p-1/pos/2.26.txt | 62 +++ .../boolean-literals/p-1/pos/2.3.kt | 27 ++ .../boolean-literals/p-1/pos/2.3.txt | 319 +++++++++++++ .../boolean-literals/p-1/pos/2.4.kt | 12 + .../boolean-literals/p-1/pos/2.4.txt | 16 + .../boolean-literals/p-1/pos/2.5.kt | 12 + .../boolean-literals/p-1/pos/2.5.txt | 16 + .../boolean-literals/p-1/pos/2.6.kt | 12 + .../boolean-literals/p-1/pos/2.6.txt | 8 + .../boolean-literals/p-1/pos/2.7.kt | 15 + .../boolean-literals/p-1/pos/2.7.txt | 71 +++ .../boolean-literals/p-1/pos/2.8.kt | 18 + .../boolean-literals/p-1/pos/2.8.txt | 94 ++++ .../boolean-literals/p-1/pos/2.9.kt | 33 ++ .../boolean-literals/p-1/pos/2.9.txt | 342 ++++++++++++++ .../parsing/ParsingTestSpecGenerated.java | 369 +++++++++++++++ .../kotlin/spec/tasks/GenerateSpecTests.kt | 4 + 106 files changed, 7861 insertions(+) create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.1.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.1.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.10.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.10.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.11.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.11.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.12.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.12.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.13.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.13.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.14.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.14.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.15.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.15.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.16.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.16.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.17.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.17.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.18.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.18.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.19.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.19.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.2.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.2.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.20.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.20.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.21.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.21.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.22.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.22.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.23.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.23.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.24.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.24.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.25.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.25.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.26.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.26.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.3.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.3.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.4.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.4.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.5.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.5.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.6.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.6.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.7.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.7.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.8.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.8.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.9.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.9.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.1.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.1.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.10.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.10.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.11.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.11.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.12.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.12.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.13.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.13.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.14.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.14.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.15.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.15.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.16.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.16.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.17.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.17.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.18.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.18.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.19.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.19.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.2.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.2.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.20.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.20.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.21.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.21.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.22.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.22.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.23.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.23.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.24.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.24.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.25.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.25.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.26.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.26.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.3.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.3.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.4.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.4.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.5.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.5.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.6.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.6.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.7.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.7.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.8.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.8.txt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.9.kt create mode 100644 compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.9.txt create mode 100644 compiler/tests-spec/tests/org/jetbrains/kotlin/parsing/ParsingTestSpecGenerated.java diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.1.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.1.kt new file mode 100644 index 00000000000..4bbcc3beb81 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.1.kt @@ -0,0 +1,20 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 1 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the class. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class true {} + +internal class A: false {} + +interface true {} + +interface A: @false B {} + +interface A: B, C, true {} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.1.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.1.txt new file mode 100644 index 00000000000..a3fd31abb95 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.1.txt @@ -0,0 +1,98 @@ +KtFile: 2.1.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiErrorElement:Name expected + PsiElement(true)('true') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + MODIFIER_LIST + PsiElement(internal)('internal') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(interface)('interface') + PsiWhiteSpace(' ') + PsiErrorElement:Name expected + PsiElement(true)('true') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(interface)('interface') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + MODIFIER_LIST + PsiErrorElement:Expected annotation identifier after '@' + PsiElement(AT)('@') + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting a top level declaration + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + FUN + PsiErrorElement:Expecting a top level declaration + + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(interface)('interface') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('C') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + SUPER_TYPE_ENTRY + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.10.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.10.kt new file mode 100644 index 00000000000..1460398b1de --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.10.kt @@ -0,0 +1,28 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 10 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the companionObject. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class A { + companion object true { + + } +} + +class B { + companion object false: A() { + + } +} + +class C { + companion object true: B by expr, x1, A() { + + } +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.10.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.10.txt new file mode 100644 index 00000000000..8738ce0708d --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.10.txt @@ -0,0 +1,119 @@ +KtFile: 2.10.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + OBJECT_DECLARATION + MODIFIER_LIST + PsiElement(companion)('companion') + PsiWhiteSpace(' ') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiWhiteSpace(' ') + FUN + PsiErrorElement:Expecting member declaration + + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + OBJECT_DECLARATION + MODIFIER_LIST + PsiElement(companion)('companion') + PsiWhiteSpace(' ') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiErrorElement:Expecting member declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Expecting member declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting member declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + FUN + PsiErrorElement:Expecting member declaration + + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('C') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + OBJECT_DECLARATION + MODIFIER_LIST + PsiElement(companion)('companion') + PsiWhiteSpace(' ') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiErrorElement:Expecting member declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('by') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('expr') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('x1') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Expecting member declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting member declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + FUN + PsiErrorElement:Expecting member declaration + + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.11.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.11.kt new file mode 100644 index 00000000000..bc671e821da --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.11.kt @@ -0,0 +1,16 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 11 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the function. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun true() {} + +suspend fun false() {} + +inline fun true() = false diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.11.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.11.txt new file mode 100644 index 00000000000..f7269b00f1b --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.11.txt @@ -0,0 +1,62 @@ +KtFile: 2.11.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting function name or receiver type + PsiElement(true)('true') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + MODIFIER_LIST + PsiElement(suspend)('suspend') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting function name or receiver type + PsiElement(false)('false') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + MODIFIER_LIST + PsiElement(inline)('inline') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Number') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting function name or receiver type + PsiElement(true)('true') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.12.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.12.kt new file mode 100644 index 00000000000..9ddd926b551 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.12.kt @@ -0,0 +1,25 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 12 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the setter. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class A { + var x1: String + set(private true) = false + + var x2: String + set(abstract final true) { + return field + } +} + +var x3 = 0L + set(suspend false) { + return field + } diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.12.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.12.txt new file mode 100644 index 00000000000..0b84f1cbd31 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.12.txt @@ -0,0 +1,111 @@ +KtFile: 2.12.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting parameter name + PsiElement(true)('true') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting parameter name + PsiElement(true)('true') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('field') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0L') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(suspend)('suspend') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting parameter name + PsiElement(false)('false') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('field') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.13.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.13.kt new file mode 100644 index 00000000000..bdbd3ab4714 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.13.kt @@ -0,0 +1,18 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 13 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the simpleUserType. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1(a: true) {} + +fun f2(a: false<*>) {} + +fun f3(a: true) {} + +fun f4(a: false>>) {} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.13.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.13.txt new file mode 100644 index 00000000000..4abee8ad08d --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.13.txt @@ -0,0 +1,134 @@ +KtFile: 2.13.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f2') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiErrorElement:Expecting comma or ')' + + PsiErrorElement:Expecting ')' + PsiElement(LT)('<') + PsiErrorElement:Expecting a top level declaration + PsiElement(MUL)('*') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting a top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + FUN + PsiErrorElement:Expecting a top level declaration + + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f3') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiErrorElement:Expecting comma or ')' + + PsiErrorElement:Expecting ')' + PsiElement(LT)('<') + MODIFIER_LIST + PsiElement(out)('out') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting a top level declaration + PsiElement(MUL)('*') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting a top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + FUN + PsiErrorElement:Expecting a top level declaration + + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f4') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiErrorElement:Expecting comma or ')' + + PsiErrorElement:Expecting ')' + PsiElement(LT)('<') + MODIFIER_LIST + PsiElement(in)('in') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting a top level declaration + PsiElement(IDENTIFIER)('List') + PsiErrorElement:Expecting a top level declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting a top level declaration + PsiElement(true)('true') + PsiErrorElement:Expecting a top level declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting a top level declaration + PsiElement(MUL)('*') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting a top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + FUN + PsiErrorElement:Expecting a top level declaration + + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.14.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.14.kt new file mode 100644 index 00000000000..0d7882ed85b --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.14.kt @@ -0,0 +1,24 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 14 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the typeParameter. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1() {} + +fun T.f2() {} + +class B>> {} + +class B> {} + +fun T.f3() {} + +fun f4(a: List) {} + +fun f5(a: List>>) {} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.14.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.14.txt new file mode 100644 index 00000000000..71ff4e4dcef --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.14.txt @@ -0,0 +1,246 @@ +KtFile: 2.14.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiErrorElement:Type parameter name expected + PsiElement(true)('true') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + MODIFIER_LIST + PsiElement(reified)('reified') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('f2') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('K') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('L') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('M') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('K') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + MODIFIER_LIST + PsiElement(in)('in') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + PsiErrorElement:Expecting type name + + PsiErrorElement:Missing '>' + PsiElement(true)('true') + PsiErrorElement:Expecting function name or receiver type + PsiElement(GT)('>') + PsiErrorElement:Expecting '(' + + PsiWhiteSpace(' ') + PsiErrorElement:Expecting a top level declaration + PsiElement(IDENTIFIER)('T') + PsiErrorElement:Expecting a top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting a top level declaration + PsiElement(IDENTIFIER)('f3') + PsiErrorElement:Expecting a top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting a top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + FUN + PsiErrorElement:Expecting a top level declaration + + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f4') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + MODIFIER_LIST + PsiElement(out)('out') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f5') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + NULLABLE_TYPE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiElement(QUEST)('?') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.15.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.15.kt new file mode 100644 index 00000000000..60eaf4fd93e --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.15.kt @@ -0,0 +1,23 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 15 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the parameter. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1(true: Int) {} + +fun f2(false: Boolean, true: Boolean) = false + +fun f3(val true: Boolean = false, var true: Boolean) = false + +class A { + val x1: Boolean = true + set(false) = true + var x2: Boolean = false + set(vararg true: Boolean) = false +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.15.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.15.txt new file mode 100644 index 00000000000..1c61910751f --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.15.txt @@ -0,0 +1,179 @@ +KtFile: 2.15.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiErrorElement:Parameter name expected + PsiElement(true)('true') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f2') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiErrorElement:Parameter name expected + PsiElement(false)('false') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiErrorElement:Parameter name expected + PsiElement(true)('true') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f3') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiErrorElement:Parameter name expected + PsiElement(true)('true') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiErrorElement:Parameter name expected + PsiElement(true)('true') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + PsiErrorElement:Expecting parameter name + PsiElement(false)('false') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(vararg)('vararg') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting parameter name + PsiElement(true)('true') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.16.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.16.kt new file mode 100644 index 00000000000..d960b5948b5 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.16.kt @@ -0,0 +1,12 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 16 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the fileAnnotationComplex. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +@file:[JvmName.true()] diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.16.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.16.txt new file mode 100644 index 00000000000..ae6f477426d --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.16.txt @@ -0,0 +1,36 @@ +KtFile: 2.16.kt + FILE_ANNOTATION_LIST + ANNOTATION + PsiElement(AT)('@') + ANNOTATION_TARGET + PsiElement(file)('file') + PsiElement(COLON)(':') + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('JvmName') + PsiElement(DOT)('.') + PsiErrorElement:Expecting type name + + PACKAGE_DIRECTIVE + + IMPORT_LIST + + PsiErrorElement:Expecting a top level declaration + PsiElement(true)('true') + PsiErrorElement:Expecting a top level declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting a top level declaration + PsiElement(false)('false') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting a top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting a top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting a top level declaration + PsiElement(RBRACKET)(']') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.17.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.17.kt new file mode 100644 index 00000000000..d8ba0aa2216 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.17.kt @@ -0,0 +1,18 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 17 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the object. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +object A : true {} + +object B : A, false> {} + +object true constructor() {} + +object false : true {} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.17.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.17.txt new file mode 100644 index 00000000000..5783fca6fa5 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.17.txt @@ -0,0 +1,109 @@ +KtFile: 2.17.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + OBJECT_DECLARATION + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + OBJECT_DECLARATION + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + OBJECT_DECLARATION + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiErrorElement:Name expected + PsiElement(true)('true') + PsiWhiteSpace(' ') + PRIMARY_CONSTRUCTOR + PsiElement(constructor)('constructor') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + OBJECT_DECLARATION + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiErrorElement:Name expected + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiErrorElement:Expecting a top level declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting a top level declaration + PsiElement(false)('false') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') + PsiWhiteSpace(' ') + FUN + PsiErrorElement:Expecting a top level declaration + + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.18.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.18.kt new file mode 100644 index 00000000000..746545a23e4 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.18.kt @@ -0,0 +1,16 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 18 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the typeAlias. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +typealias true = Boolean + +private typealias false = List + +internal typealias true = Map, List> diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.18.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.18.txt new file mode 100644 index 00000000000..90c486796aa --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.18.txt @@ -0,0 +1,95 @@ +KtFile: 2.18.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + TYPEALIAS + PsiElement(typealias)('typealias') + PsiWhiteSpace(' ') + PsiErrorElement:Type name expected + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace('\n\n') + TYPEALIAS + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + PsiElement(typealias)('typealias') + PsiWhiteSpace(' ') + PsiErrorElement:Type name expected + PsiElement(false)('false') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(GT)('>') + PsiWhiteSpace('\n\n') + TYPEALIAS + MODIFIER_LIST + PsiElement(internal)('internal') + PsiWhiteSpace(' ') + PsiElement(typealias)('typealias') + PsiWhiteSpace(' ') + PsiErrorElement:Type name expected + PsiElement(true)('true') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiErrorElement:Type parameter name expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Map') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiErrorElement:Expecting a '>' + + PsiErrorElement:Expecting a top level declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting a top level declaration + PsiElement(false)('false') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting a top level declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting a top level declaration + PsiElement(IDENTIFIER)('List') + PsiErrorElement:Expecting a top level declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting a top level declaration + PsiElement(true)('true') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting a top level declaration + PsiElement(GT)('>') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.19.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.19.kt new file mode 100644 index 00000000000..b7daa3723a3 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.19.kt @@ -0,0 +1,20 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 19 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the import. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +import org.jetbrains.true.* + +import false + +import true.*; + +import false.*import true + +import org.jetbrains.kotlin as false diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.19.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.19.txt new file mode 100644 index 00000000000..f1e8051401b --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.19.txt @@ -0,0 +1,65 @@ +KtFile: 2.19.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + PsiErrorElement:Qualified name must be a '.'-separated identifier list + PsiElement(true)('true') + PsiElement(DOT)('.') + PsiElement(MUL)('*') + PsiWhiteSpace('\n\n') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting qualified name + PsiElement(false)('false') + PsiWhiteSpace('\n\n') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting qualified name + PsiElement(true)('true') + PsiElement(DOT)('.') + PsiElement(MUL)('*') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n\n') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting qualified name + PsiElement(false)('false') + PsiElement(DOT)('.') + PsiElement(MUL)('*') + PsiElement(IDENTIFIER)('import') + PsiWhiteSpace(' ') + PsiElement(true)('true') + PsiWhiteSpace('\n\n') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('kotlin') + PsiWhiteSpace(' ') + IMPORT_ALIAS + PsiElement(as)('as') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting identifier + PsiElement(false)('false') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.2.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.2.kt new file mode 100644 index 00000000000..e7406d2de8e --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.2.kt @@ -0,0 +1,19 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 2 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the labelReference. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f() { + return@true + + while (true) { + break@false + continue@true + } +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.2.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.2.txt new file mode 100644 index 00000000000..b8f81cee35a --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.2.txt @@ -0,0 +1,57 @@ +KtFile: 2.2.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + RETURN + PsiElement(return)('return') + PsiErrorElement:Label must be named + PsiElement(AT)('@') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n\n ') + WHILE + PsiElement(while)('while') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + CONDITION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BREAK + PsiElement(break)('break') + PsiErrorElement:Label must be named + PsiElement(AT)('@') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n ') + CONTINUE + PsiElement(continue)('continue') + PsiErrorElement:Label must be named + PsiElement(AT)('@') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.20.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.20.kt new file mode 100644 index 00000000000..e4beaec53b7 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.20.kt @@ -0,0 +1,16 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 20 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the infixFunctionCall. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f() { + 1 + 1 true 10..11 + + 1 + 1 false 10..11 true 10 false -.9-9.0 +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.20.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.20.txt new file mode 100644 index 00000000000..1961605ebb3 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.20.txt @@ -0,0 +1,68 @@ +KtFile: 2.20.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(INTEGER_LITERAL)('10') + PsiElement(RANGE)('..') + PsiElement(INTEGER_LITERAL)('11') + PsiWhiteSpace('\n\n ') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(INTEGER_LITERAL)('10') + PsiElement(RANGE)('..') + PsiElement(INTEGER_LITERAL)('11') + PsiWhiteSpace(' ') + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(INTEGER_LITERAL)('10') + PsiWhiteSpace(' ') + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(MINUS)('-') + PsiElement(FLOAT_CONSTANT)('.9') + PsiElement(MINUS)('-') + PsiElement(FLOAT_CONSTANT)('9.0') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.21.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.21.kt new file mode 100644 index 00000000000..67225667ace --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.21.kt @@ -0,0 +1,16 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 21 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the catchBlock. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f() { + try {} catch (true: Any) {} + + try {} catch (@a false: Any) {} +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.21.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.21.txt new file mode 100644 index 00000000000..b51eafd9cfe --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.21.txt @@ -0,0 +1,80 @@ +KtFile: 2.21.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + TRY + PsiElement(try)('try') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + CATCH + PsiElement(catch)('catch') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiErrorElement:Parameter name expected + PsiElement(true)('true') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + TRY + PsiElement(try)('try') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + CATCH + PsiElement(catch)('catch') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiErrorElement:Parameter name expected + PsiElement(false)('false') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.22.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.22.kt new file mode 100644 index 00000000000..33b45021969 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.22.kt @@ -0,0 +1,32 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 22 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the labelDefinition. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f() { + val lambda_1 = true@ {} + + val lambda_2 = false@ { + println(1) + } + + val lambda_3 = @someAnotation true@ { + println(1) + } + + val lambda_4 = @someAnotation1 @someAnotation2 @someAnotation3 false@ { + println(1) + } + + val x1 = true@ 10 - 1 + val x2 = false@(listOf(1)) + val x3 = true@(return return) && false@ return return + val x4 = true@ try {} finally {} && false@ return return + val x5 = true@ try { false } catch(e: E) {} catch (e: Exception) { true } && false@ when (value) { true@ true -> false@ false; true@ false -> false@ true } +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.22.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.22.txt new file mode 100644 index 00000000000..94efc93926f --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.22.txt @@ -0,0 +1,400 @@ +KtFile: 2.22.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('lambda_1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + LAMBDA_ARGUMENT + ANNOTATED_EXPRESSION + PsiErrorElement:Expected annotation identifier after '@' + PsiElement(AT)('@') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('lambda_2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(false)('false') + LAMBDA_ARGUMENT + ANNOTATED_EXPRESSION + PsiErrorElement:Expected annotation identifier after '@' + PsiElement(AT)('@') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BLOCK + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('lambda_3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + ANNOTATED_EXPRESSION + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('someAnotation') + PsiWhiteSpace(' ') + CALL_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + LAMBDA_ARGUMENT + ANNOTATED_EXPRESSION + PsiErrorElement:Expected annotation identifier after '@' + PsiElement(AT)('@') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BLOCK + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('lambda_4') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + ANNOTATED_EXPRESSION + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('someAnotation1') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('someAnotation2') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('someAnotation3') + PsiWhiteSpace(' ') + CALL_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(false)('false') + LAMBDA_ARGUMENT + ANNOTATED_EXPRESSION + PsiErrorElement:Expected annotation identifier after '@' + PsiElement(AT)('@') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BLOCK + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(INTEGER_LITERAL)('10') + PsiWhiteSpace(' ') + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(AT)('@') + PsiElement(LPAR)('(') + PsiElement(IDENTIFIER)('listOf') + PsiElement(LPAR)('(') + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(AT)('@') + PsiElement(LPAR)('(') + PsiElement(return)('return') + PsiWhiteSpace(' ') + PsiElement(return)('return') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ANDAND)('&&') + PsiWhiteSpace(' ') + PsiElement(false)('false') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(return)('return') + PsiWhiteSpace(' ') + PsiElement(return)('return') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x4') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(try)('try') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + BINARY_EXPRESSION + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('finally') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(ANDAND)('&&') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(return)('return') + PsiWhiteSpace(' ') + PsiElement(return)('return') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x5') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(try)('try') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace(' ') + BLOCK + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('catch') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('e') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('E') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('catch') + PsiWhiteSpace(' ') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('e') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Exception') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace(' ') + BLOCK + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(ANDAND)('&&') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(when)('when') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(IDENTIFIER)('value') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace(' ') + BLOCK + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(false)('false') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(false)('false') + PsiErrorElement:Expecting an element + PsiElement(SEMICOLON)(';') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(false)('false') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.23.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.23.kt new file mode 100644 index 00000000000..059b1b9aecf --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.23.kt @@ -0,0 +1,20 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 23 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the atomicExpression. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +val true = 10 +val false = "." + +val value_1 = true - 100 % false +val value_2 = true.dec() +val value_3 = "$false 10" +val value_4 = "${true}" +val value_5 = false + " 11..." + true + "1" +val value_6 = false diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.23.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.23.txt new file mode 100644 index 00000000000..664e379462f --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.23.txt @@ -0,0 +1,151 @@ +KtFile: 2.23.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting property name or receiver type + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting property name or receiver type + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('.') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('100') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PERC)('%') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiElement(DOT)('.') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('dec') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + PsiErrorElement:Keyword cannot be used as a reference + PsiElement(false)('false') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)(' 10') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_4') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LONG_STRING_TEMPLATE_ENTRY + PsiElement(LONG_TEMPLATE_ENTRY_START)('${') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiElement(LONG_TEMPLATE_ENTRY_END)('}') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_5') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)(' 11...') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('1') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_6') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.24.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.24.kt new file mode 100644 index 00000000000..52f866a1799 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.24.kt @@ -0,0 +1,26 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 24 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the variableDeclarationEntry. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1() { + for (true: Any in 0..10) {} + + val x1 = {false: Boolean -> + println("1") + } + + val x2 = {true: Boolean, false: true -> } + + var false: Boolean; + + val x3 = fun(true: Boolean) { + + }(false) +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.24.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.24.txt new file mode 100644 index 00000000000..ead25c36ef0 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.24.txt @@ -0,0 +1,158 @@ +KtFile: 2.24.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiErrorElement:Expecting a variable name + PsiElement(true)('true') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace('\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('1') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Boolean') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(false)('false') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting property name or receiver type + PsiElement(false)('false') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + FUN + PsiElement(fun)('fun') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiErrorElement:Parameter name expected + PsiElement(true)('true') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.25.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.25.kt new file mode 100644 index 00000000000..b8aa7912eb9 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.25.kt @@ -0,0 +1,22 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 25 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the valueArgument. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1() { + f2(true = expr) + + f3(false = (0L - 10 + throw E() - -.09)) + + f4( + true = return return, + false = try {} finally {}, + true = 0x10 + ) +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.25.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.25.txt new file mode 100644 index 00000000000..78e8b27a4aa --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.25.txt @@ -0,0 +1,142 @@ +KtFile: 2.25.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('f2') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + BINARY_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('expr') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('f3') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + BINARY_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0L') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + THROW + PsiElement(throw)('throw') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('E') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + PREFIX_EXPRESSION + OPERATION_REFERENCE + PsiElement(MINUS)('-') + FLOAT_CONSTANT + PsiElement(FLOAT_CONSTANT)('.09') + PsiElement(RPAR)(')') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('f4') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiWhiteSpace('\n ') + VALUE_ARGUMENT + BINARY_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_ARGUMENT + BINARY_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TRY + PsiElement(try)('try') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + FINALLY + PsiElement(finally)('finally') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_ARGUMENT + BINARY_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0x10') + PsiWhiteSpace('\n ') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.26.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.26.kt new file mode 100644 index 00000000000..353183f4aaf --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.26.kt @@ -0,0 +1,18 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 26 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the callableReference. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun case_1() { + Boolean::true + + Boolean???::false::true::false + + org.jetbrains.Boolean?::true::false +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.26.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.26.txt new file mode 100644 index 00000000000..ac2974b3d42 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.26.txt @@ -0,0 +1,80 @@ +KtFile: 2.26.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('case_1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + CALLABLE_REFERENCE_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiErrorElement:Expecting an identifier + + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n\n ') + CALLABLE_REFERENCE_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(QUEST)('?') + PsiElement(QUEST)('?') + PsiElement(QUEST)('?') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiErrorElement:Expecting an identifier + + CALLABLE_REFERENCE_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiErrorElement:Expecting an identifier + + CALLABLE_REFERENCE_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiErrorElement:Expecting an identifier + + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n\n ') + CALLABLE_REFERENCE_EXPRESSION + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(QUEST)('?') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiErrorElement:Expecting an identifier + + CALLABLE_REFERENCE_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiErrorElement:Expecting an identifier + + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.3.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.3.kt new file mode 100644 index 00000000000..7bd51cd3a57 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.3.kt @@ -0,0 +1,27 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 3 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the typeConstraint. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class A + where true : CharSequence, + false : Comparable + +annotation class B + where true : CharSequence, + @A> @B false : Comparable + +annotation class C where @property:C false : CharSequence, true : Comparable + +fun d(): Boolean + where true : Any, + false : Iterable<*>, + true : Collection<*>, + false : MutableCollection<*>, + true : Comparable = true == false \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.3.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.3.txt new file mode 100644 index 00000000000..c189fcaf229 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.3.txt @@ -0,0 +1,322 @@ +KtFile: 2.3.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiErrorElement:Type parameter name expected + PsiElement(true)('true') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiErrorElement:Type parameter name expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiWhiteSpace('\n ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + PsiErrorElement:Expecting type parameter name + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('CharSequence') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + PsiErrorElement:Expecting type parameter name + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Comparable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiElement(GT)('>') + PsiWhiteSpace('\n\n') + CLASS + MODIFIER_LIST + PsiElement(annotation)('annotation') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiErrorElement:Type parameter name expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiWhiteSpace('\n ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + PsiErrorElement:Expecting type parameter name + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('CharSequence') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Nothing') + PsiElement(QUEST)('?') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting type parameter name + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Comparable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(true)('true') + PsiElement(GT)('>') + PsiWhiteSpace('\n\n') + CLASS + MODIFIER_LIST + PsiElement(annotation)('annotation') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('C') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiErrorElement:Type parameter name expected + PsiElement(false)('false') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiErrorElement:Type parameter name expected + PsiElement(true)('true') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + ANNOTATION_ENTRY + PsiElement(AT)('@') + ANNOTATION_TARGET + PsiElement(property)('property') + PsiElement(COLON)(':') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('C') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting type parameter name + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('CharSequence') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT + PsiErrorElement:Expecting type parameter name + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Comparable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiErrorElement:Type parameter name expected + PsiElement(true)('true') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiErrorElement:Type parameter name expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('d') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace('\n ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + PsiErrorElement:Expecting type parameter name + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + PsiErrorElement:Expecting type parameter name + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Iterable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + PsiElement(MUL)('*') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + PsiErrorElement:Expecting type parameter name + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Collection') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + PsiElement(MUL)('*') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + PsiErrorElement:Expecting type parameter name + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('MutableCollection') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + PsiElement(MUL)('*') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + PsiErrorElement:Expecting type parameter name + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Comparable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(false)('false') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EQEQ)('==') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.4.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.4.kt new file mode 100644 index 00000000000..45ee09bec91 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.4.kt @@ -0,0 +1,12 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 4 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the fileAnnotationSimple. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +@file:true diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.4.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.4.txt new file mode 100644 index 00000000000..0f20ea11c36 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.4.txt @@ -0,0 +1,12 @@ +KtFile: 2.4.kt + FILE_ANNOTATION_LIST + PsiErrorElement:Expected annotation identifier after ':' + PsiElement(AT)('@') + PsiElement(IDENTIFIER)('file') + PsiElement(COLON)(':') + PACKAGE_DIRECTIVE + + IMPORT_LIST + + PsiErrorElement:Expecting a top level declaration + PsiElement(true)('true') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.5.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.5.kt new file mode 100644 index 00000000000..c2c68526c6d --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.5.kt @@ -0,0 +1,12 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 5 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the packageComplex. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +package org.jetbrains.true diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.5.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.5.txt new file mode 100644 index 00000000000..3074e549d0b --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.5.txt @@ -0,0 +1,16 @@ +KtFile: 2.5.kt + PACKAGE_DIRECTIVE + PsiElement(package)('package') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + PsiErrorElement:Package name must be a '.'-separated identifier list + PsiElement(true)('true') + IMPORT_LIST + \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.6.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.6.kt new file mode 100644 index 00000000000..74bd7cf90f5 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.6.kt @@ -0,0 +1,12 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 6 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the packageSimple. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +package true diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.6.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.6.txt new file mode 100644 index 00000000000..dcf7ffdda91 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.6.txt @@ -0,0 +1,8 @@ +KtFile: 2.6.kt + PACKAGE_DIRECTIVE + PsiElement(package)('package') + PsiWhiteSpace(' ') + PsiErrorElement:Package name must be a '.'-separated identifier list + PsiElement(true)('true') + IMPORT_LIST + \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.7.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.7.kt new file mode 100644 index 00000000000..360e48f460c --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.7.kt @@ -0,0 +1,15 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 7 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the enumEntry. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +enum class A(x1: Any?) { + true("1"), + false("2"); +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.7.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.7.txt new file mode 100644 index 00000000000..2d3c1d2e2bf --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.7.txt @@ -0,0 +1,62 @@ +KtFile: 2.7.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x1') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(QUEST)('?') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting ';' after the last enum entry or '}' to close enum class body + + PsiWhiteSpace('\n ') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiErrorElement:Expecting member declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting member declaration + PsiElement(OPEN_QUOTE)('"') + PsiErrorElement:Expecting member declaration + PsiElement(REGULAR_STRING_PART)('1') + PsiErrorElement:Expecting member declaration + PsiElement(CLOSING_QUOTE)('"') + PsiErrorElement:Expecting member declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiErrorElement:Expecting member declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting member declaration + PsiElement(OPEN_QUOTE)('"') + PsiErrorElement:Expecting member declaration + PsiElement(REGULAR_STRING_PART)('2') + PsiErrorElement:Expecting member declaration + PsiElement(CLOSING_QUOTE)('"') + PsiErrorElement:Expecting member declaration + PsiElement(RPAR)(')') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.8.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.8.kt new file mode 100644 index 00000000000..b5e4f90da8f --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.8.kt @@ -0,0 +1,18 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 8 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the stringTemplateElement. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1() { + val x1 = "$true" + + val x2 = "..." + "...$false..." + "..." + + var x3 = "$true$false$true" +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.8.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.8.txt new file mode 100644 index 00000000000..31713ec84eb --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.8.txt @@ -0,0 +1,94 @@ +KtFile: 2.8.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + PsiErrorElement:Keyword cannot be used as a reference + PsiElement(true)('true') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + BINARY_EXPRESSION + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('...') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('...') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + PsiErrorElement:Keyword cannot be used as a reference + PsiElement(false)('false') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('...') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('...') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + PsiErrorElement:Keyword cannot be used as a reference + PsiElement(true)('true') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + PsiErrorElement:Keyword cannot be used as a reference + PsiElement(false)('false') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + PsiErrorElement:Keyword cannot be used as a reference + PsiElement(true)('true') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.9.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.9.kt new file mode 100644 index 00000000000..d7601fd1fa3 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.9.kt @@ -0,0 +1,33 @@ +/* + KOTLIN PSI SPEC TEST (NEGATIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 9 + DESCRIPTION: The use of Boolean literals as the identifier (without backtick) in the unescapedAnnotation. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class A { + @field:true + val a: Int = "" + + @setparam:false(true) + val b: Int = "" + + @receiver:org.jetbrains.false>(true) + val c: Int = "" + + @org.jetbrains.false + val c: Int = "" + + @true, C>(false, true, false) + val c: Int = "" + + @true + val c: Int = "" + + @false.true.false, C>(true, false, true) + val c: Int = "" +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.9.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.9.txt new file mode 100644 index 00000000000..310628754cd --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.9.txt @@ -0,0 +1,311 @@ +KtFile: 2.9.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + MODIFIER_LIST + PsiErrorElement:Expected annotation identifier after ':' + PsiElement(AT)('@') + PsiElement(IDENTIFIER)('field') + PsiElement(COLON)(':') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + MODIFIER_LIST + PsiErrorElement:Expected annotation identifier after ':' + PsiElement(AT)('@') + PsiElement(IDENTIFIER)('setparam') + PsiElement(COLON)(':') + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiErrorElement:Expecting member declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiErrorElement:Expecting member declaration + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + ANNOTATION_TARGET + PsiElement(receiver)('receiver') + PsiElement(COLON)(':') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + PsiErrorElement:Expecting type name + + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiErrorElement:Expecting member declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Expecting member declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('B') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('C') + PsiErrorElement:Expecting member declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting member declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting member declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiErrorElement:Expecting member declaration + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + PsiErrorElement:Expecting type name + + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + MODIFIER_LIST + PsiErrorElement:Expected annotation identifier after '@' + PsiElement(AT)('@') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiErrorElement:Expecting member declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Expecting member declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('B') + PsiErrorElement:Expecting member declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('C') + PsiErrorElement:Expecting member declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting member declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiErrorElement:Expecting member declaration + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + MODIFIER_LIST + PsiErrorElement:Expected annotation identifier after '@' + PsiElement(AT)('@') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + MODIFIER_LIST + PsiErrorElement:Expected annotation identifier after '@' + PsiElement(AT)('@') + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiErrorElement:Expecting member declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiErrorElement:Expecting member declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiErrorElement:Expecting member declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Expecting member declaration + PsiElement(LT)('<') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('B') + PsiErrorElement:Expecting member declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(IDENTIFIER)('C') + PsiErrorElement:Expecting member declaration + PsiElement(GT)('>') + PsiErrorElement:Expecting member declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(false)('false') + PsiErrorElement:Expecting member declaration + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting member declaration + PsiElement(true)('true') + PsiErrorElement:Expecting member declaration + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.1.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.1.kt new file mode 100644 index 00000000000..b14c5eb38bc --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.1.kt @@ -0,0 +1,20 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 1 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class `true` {} + +internal class A: `false` {} + +interface `true` {} + +interface A: @`false` B {} + +interface A: B, C, `true` {} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.1.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.1.txt new file mode 100644 index 00000000000..60eed282adc --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.1.txt @@ -0,0 +1,99 @@ +KtFile: 2.1.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + MODIFIER_LIST + PsiElement(internal)('internal') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(interface)('interface') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(interface)('interface') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(interface)('interface') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('C') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.10.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.10.kt new file mode 100644 index 00000000000..926ac7bb42c --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.10.kt @@ -0,0 +1,28 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 10 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the companionObject. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class A { + companion object `true` { + + } +} + +class B { + companion object `false`: A() { + + } +} + +class C { + companion object `true`: B by expr, x1, A() { + + } +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.10.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.10.txt new file mode 100644 index 00000000000..e4a8721483e --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.10.txt @@ -0,0 +1,116 @@ +KtFile: 2.10.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + OBJECT_DECLARATION + MODIFIER_LIST + PsiElement(companion)('companion') + PsiWhiteSpace(' ') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + OBJECT_DECLARATION + MODIFIER_LIST + PsiElement(companion)('companion') + PsiWhiteSpace(' ') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`false`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('C') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + OBJECT_DECLARATION + MODIFIER_LIST + PsiElement(companion)('companion') + PsiWhiteSpace(' ') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + DELEGATED_SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + PsiElement(by)('by') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('expr') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x1') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + SUPER_TYPE_CALL_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.11.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.11.kt new file mode 100644 index 00000000000..7fb3af32d75 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.11.kt @@ -0,0 +1,16 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 11 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the function. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun `true`() {} + +suspend fun `false`() {} + +inline fun `true`() = `false` diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.11.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.11.txt new file mode 100644 index 00000000000..608049ac0fc --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.11.txt @@ -0,0 +1,59 @@ +KtFile: 2.11.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + MODIFIER_LIST + PsiElement(suspend)('suspend') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`false`') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + MODIFIER_LIST + PsiElement(inline)('inline') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Number') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.12.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.12.kt new file mode 100644 index 00000000000..81a93a7338a --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.12.kt @@ -0,0 +1,25 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 12 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the setter. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class A { + var x1: String + set(private `true`) = `false` + + var x2: String + set(abstract final `true`) { + return field + } +} + +var x3 = 0L + set(suspend `false`) { + return field + } diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.12.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.12.txt new file mode 100644 index 00000000000..dde317d5649 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.12.txt @@ -0,0 +1,108 @@ +KtFile: 2.12.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('field') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0L') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(suspend)('suspend') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`false`') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('field') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.13.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.13.kt new file mode 100644 index 00000000000..096fd4ade1c --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.13.kt @@ -0,0 +1,18 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 13 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the simpleUserType. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1(a: `true`) {} + +fun f2(a: `false`<*>) {} + +fun f3(a: `true`) {} + +fun f4(a: `false`>>) {} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.13.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.13.txt new file mode 100644 index 00000000000..1a181c3cd48 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.13.txt @@ -0,0 +1,121 @@ +KtFile: 2.13.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f2') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + PsiElement(MUL)('*') + PsiElement(GT)('>') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f3') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + MODIFIER_LIST + PsiElement(out)('out') + PsiWhiteSpace(' ') + PsiElement(MUL)('*') + PsiElement(GT)('>') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f4') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + MODIFIER_LIST + PsiElement(in)('in') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + PsiElement(MUL)('*') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.14.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.14.kt new file mode 100644 index 00000000000..52784c0da7b --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.14.kt @@ -0,0 +1,24 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 14 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the typeParameter. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun <`true`> f1() {} + +fun T.f2() {} + +class B>> {} + +class B> {} + +fun T.f3() {} + +fun f4(a: List) {} + +fun f5(a: List>>) {} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.14.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.14.txt new file mode 100644 index 00000000000..a5b637e8891 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.14.txt @@ -0,0 +1,241 @@ +KtFile: 2.14.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + MODIFIER_LIST + PsiElement(reified)('reified') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('f2') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('K') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('L') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('M') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('K') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + MODIFIER_LIST + PsiElement(in)('in') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('f3') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f4') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + MODIFIER_LIST + PsiElement(out)('out') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f5') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(QUEST)('?') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.15.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.15.kt new file mode 100644 index 00000000000..f9a999dffd6 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.15.kt @@ -0,0 +1,23 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 15 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the parameter. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1(`true`: Int) {} + +fun f2(`false`: Boolean, `true`: Boolean) = `false` + +fun f3(val `true`: Boolean = `false`, var `true`: Boolean) = `false` + +class A { + val x1: Boolean = `true` + set(`false`) = `true` + var x2: Boolean = `false` + set(vararg `true`: Boolean) = `false` +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.15.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.15.txt new file mode 100644 index 00000000000..81c5740733d --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.15.txt @@ -0,0 +1,172 @@ +KtFile: 2.15.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f2') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`false`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f3') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`false`') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n ') + PROPERTY_ACCESSOR + PsiElement(set)('set') + PsiElement(LPAR)('(') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(vararg)('vararg') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.16.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.16.kt new file mode 100644 index 00000000000..fe1a054ade5 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.16.kt @@ -0,0 +1,12 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 16 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the fileAnnotationComplex. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +@file:[JvmName.`true`<`false`>()] diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.16.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.16.txt new file mode 100644 index 00000000000..aeb5f1aa495 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.16.txt @@ -0,0 +1,34 @@ +KtFile: 2.16.kt + FILE_ANNOTATION_LIST + ANNOTATION + PsiElement(AT)('@') + ANNOTATION_TARGET + PsiElement(file)('file') + PsiElement(COLON)(':') + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('JvmName') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACKET)(']') + PACKAGE_DIRECTIVE + + IMPORT_LIST + \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.17.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.17.kt new file mode 100644 index 00000000000..4f5528661d5 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.17.kt @@ -0,0 +1,18 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 17 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the object. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +object A : `true` {} + +object B : A, `false`> {} + +object `true` constructor() {} + +object `false` : `true`<`false`> {} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.17.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.17.txt new file mode 100644 index 00000000000..bd1ab4aaeab --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.17.txt @@ -0,0 +1,111 @@ +KtFile: 2.17.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + OBJECT_DECLARATION + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + OBJECT_DECLARATION + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + OBJECT_DECLARATION + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PRIMARY_CONSTRUCTOR + PsiElement(constructor)('constructor') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + OBJECT_DECLARATION + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.18.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.18.kt new file mode 100644 index 00000000000..ece301506c2 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.18.kt @@ -0,0 +1,16 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 18 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the typeAlias. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +typealias `true` = Boolean + +private typealias `false` = List + +internal typealias `true`<`false`> = Map<`true`<`false`>, List<`true`>> diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.18.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.18.txt new file mode 100644 index 00000000000..e1d9a820fa9 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.18.txt @@ -0,0 +1,95 @@ +KtFile: 2.18.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + TYPEALIAS + PsiElement(typealias)('typealias') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace('\n\n') + TYPEALIAS + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + PsiElement(typealias)('typealias') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`false`') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('T') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(GT)('>') + PsiWhiteSpace('\n\n') + TYPEALIAS + MODIFIER_LIST + PsiElement(internal)('internal') + PsiWhiteSpace(' ') + PsiElement(typealias)('typealias') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Map') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(GT)('>') + PsiElement(GT)('>') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.19.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.19.kt new file mode 100644 index 00000000000..2733220fcd7 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.19.kt @@ -0,0 +1,20 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 19 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the import. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +import org.jetbrains.`true`.* + +import `false` + +import `true`.*; + +import `false`.*import `true` + +import org.jetbrains.kotlin as `false` diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.19.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.19.txt new file mode 100644 index 00000000000..3cd75192298 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.19.txt @@ -0,0 +1,66 @@ +KtFile: 2.19.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(DOT)('.') + PsiElement(MUL)('*') + PsiWhiteSpace('\n\n') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n\n') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(DOT)('.') + PsiElement(MUL)('*') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n\n') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(DOT)('.') + PsiElement(MUL)('*') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace('\n\n') + IMPORT_DIRECTIVE + PsiElement(import)('import') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('kotlin') + PsiWhiteSpace(' ') + IMPORT_ALIAS + PsiElement(as)('as') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`false`') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.2.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.2.kt new file mode 100644 index 00000000000..fd5533690a7 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.2.kt @@ -0,0 +1,19 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 2 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the labelReference. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f() { + return@`true` + + while (true) { + break@`false` + continue@`true` + } +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.2.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.2.txt new file mode 100644 index 00000000000..b073caa5bdd --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.2.txt @@ -0,0 +1,53 @@ +KtFile: 2.2.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + RETURN + PsiElement(return)('return') + LABEL_QUALIFIER + LABEL + PsiElement(AT)('@') + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace('\n\n ') + WHILE + PsiElement(while)('while') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + CONDITION + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BREAK + PsiElement(break)('break') + LABEL_QUALIFIER + LABEL + PsiElement(AT)('@') + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n ') + CONTINUE + PsiElement(continue)('continue') + LABEL_QUALIFIER + LABEL + PsiElement(AT)('@') + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.20.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.20.kt new file mode 100644 index 00000000000..94816d161d1 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.20.kt @@ -0,0 +1,16 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 20 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the infixFunctionCall. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f() { + 1 + 1 `true` 10..11 + + 1 + 1 `false` 10..11 `true` 10 `false` -.9-9.0 +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.20.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.20.txt new file mode 100644 index 00000000000..2ff7463284c --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.20.txt @@ -0,0 +1,83 @@ +KtFile: 2.20.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('11') + PsiWhiteSpace('\n\n ') + BINARY_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('11') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + PREFIX_EXPRESSION + OPERATION_REFERENCE + PsiElement(MINUS)('-') + FLOAT_CONSTANT + PsiElement(FLOAT_CONSTANT)('.9') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + FLOAT_CONSTANT + PsiElement(FLOAT_CONSTANT)('9.0') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.21.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.21.kt new file mode 100644 index 00000000000..c6fa2da398d --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.21.kt @@ -0,0 +1,16 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 21 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the catchBlock. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f() { + try {} catch (`true`: Any) {} + + try {} catch (@a `false`: Any) {} +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.21.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.21.txt new file mode 100644 index 00000000000..25c964d9e7f --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.21.txt @@ -0,0 +1,78 @@ +KtFile: 2.21.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + TRY + PsiElement(try)('try') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + CATCH + PsiElement(catch)('catch') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + TRY + PsiElement(try)('try') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + CATCH + PsiElement(catch)('catch') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`false`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.22.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.22.kt new file mode 100644 index 00000000000..f517d2b63a8 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.22.kt @@ -0,0 +1,32 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 22 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the labelDefinition. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f() { + val lambda_1 = `true`@ {} + + val lambda_2 = `false`@ { + println(1) + } + + val lambda_3 = @someAnotation `true`@ { + println(1) + } + + val lambda_4 = @someAnotation1 @someAnotation2 @someAnotation3 `false`@ { + println(1) + } + + val x1 = `true`@ 10 - 1 + val x2 = `false`@(listOf(1)) + val x3 = `true`@(return return) && `false`@ return return + val x4 = `true`@ try {} finally {} && `false`@ return return + val x5 = `true`@ try { false } catch(e: E) {} catch (e: Exception) { true } && `false`@ when (value) { `true`@ true -> `false`@ false; `true`@ false -> `false`@ true } +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.22.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.22.txt new file mode 100644 index 00000000000..d2b2dd35836 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.22.txt @@ -0,0 +1,421 @@ +KtFile: 2.22.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('lambda_1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`true`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('lambda_2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`false`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BLOCK + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('lambda_3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + ANNOTATED_EXPRESSION + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('someAnotation') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`true`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BLOCK + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('lambda_4') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + ANNOTATED_EXPRESSION + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('someAnotation1') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('someAnotation2') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('someAnotation3') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`false`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BLOCK + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`true`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`false`') + PsiElement(AT)('@') + PARENTHESIZED + PsiElement(LPAR)('(') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('listOf') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`true`') + PsiElement(AT)('@') + PARENTHESIZED + PsiElement(LPAR)('(') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(ANDAND)('&&') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`false`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x4') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`true`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + TRY + PsiElement(try)('try') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + FINALLY + PsiElement(finally)('finally') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(ANDAND)('&&') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`false`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x5') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`true`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + TRY + PsiElement(try)('try') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + CATCH + PsiElement(catch)('catch') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('e') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('E') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + CATCH + PsiElement(catch)('catch') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('e') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Exception') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(ANDAND)('&&') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`false`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + WHEN + PsiElement(when)('when') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('value') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(LBRACE)('{') + PsiWhiteSpace(' ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`true`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`false`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace(' ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`true`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(false)('false') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + LABELED_EXPRESSION + LABEL_QUALIFIER + LABEL + PsiElement(IDENTIFIER)('`false`') + PsiElement(AT)('@') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace(' ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.23.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.23.kt new file mode 100644 index 00000000000..4a2bf99d3ff --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.23.kt @@ -0,0 +1,20 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 23 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the atomicExpression. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +val `true` = 10 +val `false` = "." + +val value_1 = `true` - 100 % `false` +val value_2 = `true`.dec() +val value_3 = "$`false` 10" +val value_4 = "${`true`}" +val value_5 = `false` + " 11..." + `true` + "1" +val value_6 = `false` diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.23.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.23.txt new file mode 100644 index 00000000000..7db72275e40 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.23.txt @@ -0,0 +1,149 @@ +KtFile: 2.23.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('.') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('100') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PERC)('%') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(DOT)('.') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('dec') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)(' 10') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_4') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LONG_STRING_TEMPLATE_ENTRY + PsiElement(LONG_TEMPLATE_ENTRY_START)('${') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(LONG_TEMPLATE_ENTRY_END)('}') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_5') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)(' 11...') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('1') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value_6') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.24.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.24.kt new file mode 100644 index 00000000000..bb2d5004d5c --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.24.kt @@ -0,0 +1,26 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 24 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the variableDeclarationEntry. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1() { + for (`true`: Any in 0..10) {} + + val x1 = {`false`: Boolean -> + println("1") + } + + val x2 = {`true`: Boolean, `false`: `true` -> } + + var `false`: Boolean; + + val x3 = fun(`true`: Boolean) { + + }(`false`) +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.24.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.24.txt new file mode 100644 index 00000000000..e9d7a4408e8 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.24.txt @@ -0,0 +1,166 @@ +KtFile: 2.24.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`false`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace('\n ') + BLOCK + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('println') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('1') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + LAMBDA_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`false`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('`false`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + FUN + PsiElement(fun)('fun') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.25.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.25.kt new file mode 100644 index 00000000000..0584faff89c --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.25.kt @@ -0,0 +1,22 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 25 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the valueArgument. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1() { + f2(`true` = expr) + + f3(`false` = (0L - 10 + throw E() - -.09)) + + f4( + `true` = return return, + `false` = try {} finally {}, + `true` = 0x10 + ) +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.25.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.25.txt new file mode 100644 index 00000000000..d68bd3218f3 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.25.txt @@ -0,0 +1,137 @@ +KtFile: 2.25.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('f2') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + VALUE_ARGUMENT_NAME + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('expr') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('f3') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + VALUE_ARGUMENT_NAME + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0L') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + THROW + PsiElement(throw)('throw') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('E') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + PsiWhiteSpace(' ') + PREFIX_EXPRESSION + OPERATION_REFERENCE + PsiElement(MINUS)('-') + FLOAT_CONSTANT + PsiElement(FLOAT_CONSTANT)('.09') + PsiElement(RPAR)(')') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n\n ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('f4') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiWhiteSpace('\n ') + VALUE_ARGUMENT + VALUE_ARGUMENT_NAME + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + RETURN + PsiElement(return)('return') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_ARGUMENT + VALUE_ARGUMENT_NAME + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TRY + PsiElement(try)('try') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + FINALLY + PsiElement(finally)('finally') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_ARGUMENT + VALUE_ARGUMENT_NAME + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0x10') + PsiWhiteSpace('\n ') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.26.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.26.kt new file mode 100644 index 00000000000..cb6e3cc48bf --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.26.kt @@ -0,0 +1,18 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 26 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the callableReference. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun case_1() { + Boolean::`true` + + Boolean???::`false`::`true`::`false` + + org.jetbrains.Boolean?::`true`::`false` +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.26.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.26.txt new file mode 100644 index 00000000000..8895db32f7d --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.26.txt @@ -0,0 +1,62 @@ +KtFile: 2.26.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('case_1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + CALLABLE_REFERENCE_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace('\n\n ') + CALLABLE_REFERENCE_EXPRESSION + CALLABLE_REFERENCE_EXPRESSION + CALLABLE_REFERENCE_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(QUEST)('?') + PsiElement(QUEST)('?') + PsiElement(QUEST)('?') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n\n ') + CALLABLE_REFERENCE_EXPRESSION + CALLABLE_REFERENCE_EXPRESSION + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiElement(QUEST)('?') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(COLONCOLON)('::') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.3.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.3.kt new file mode 100644 index 00000000000..449abac53fb --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.3.kt @@ -0,0 +1,27 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 3 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the typeConstraint. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class A <`true`, `false`> + where `true` : CharSequence, + `false` : Comparable<`true`> + +annotation class B <`false`> + where `true` : CharSequence, + @A> @B `false` : Comparable<`true`> + +annotation class C <`false`, `true`> where @property:C `false` : CharSequence, `true` : Comparable<`false`> + +fun <`true`, `false`> d(): Boolean + where `true` : Any, + `false` : Iterable<*>, + `true` : Collection<*>, + `false` : MutableCollection<*>, + `true` : Comparable<`false`> = `true` == `false` \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.3.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.3.txt new file mode 100644 index 00000000000..3aadcc78591 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.3.txt @@ -0,0 +1,319 @@ +KtFile: 2.3.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiWhiteSpace('\n ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('CharSequence') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Comparable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(GT)('>') + PsiWhiteSpace('\n\n') + CLASS + MODIFIER_LIST + PsiElement(annotation)('annotation') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiWhiteSpace('\n ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('CharSequence') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('List') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Nothing') + PsiElement(QUEST)('?') + PsiElement(GT)('>') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Comparable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(GT)('>') + PsiWhiteSpace('\n\n') + CLASS + MODIFIER_LIST + PsiElement(annotation)('annotation') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('C') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('`false`') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + ANNOTATION_ENTRY + PsiElement(AT)('@') + ANNOTATION_TARGET + PsiElement(property)('property') + PsiElement(COLON)(':') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('C') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('CharSequence') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Comparable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('`true`') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('d') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') + PsiWhiteSpace('\n ') + PsiElement(where)('where') + PsiWhiteSpace(' ') + TYPE_CONSTRAINT_LIST + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Iterable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + PsiElement(MUL)('*') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Collection') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + PsiElement(MUL)('*') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('MutableCollection') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + PsiElement(MUL)('*') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + TYPE_CONSTRAINT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Comparable') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(EQEQ)('==') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.4.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.4.kt new file mode 100644 index 00000000000..4dac03f773e --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.4.kt @@ -0,0 +1,12 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 4 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the fileAnnotationSimple. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +@file:`true` diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.4.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.4.txt new file mode 100644 index 00000000000..37b50e003ab --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.4.txt @@ -0,0 +1,16 @@ +KtFile: 2.4.kt + FILE_ANNOTATION_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + ANNOTATION_TARGET + PsiElement(file)('file') + PsiElement(COLON)(':') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PACKAGE_DIRECTIVE + + IMPORT_LIST + \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.5.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.5.kt new file mode 100644 index 00000000000..3252d7994d7 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.5.kt @@ -0,0 +1,12 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 5 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the packageComplex. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +package org.jetbrains.`true` diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.5.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.5.txt new file mode 100644 index 00000000000..c941101a9dc --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.5.txt @@ -0,0 +1,16 @@ +KtFile: 2.5.kt + PACKAGE_DIRECTIVE + PsiElement(package)('package') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + IMPORT_LIST + \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.6.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.6.kt new file mode 100644 index 00000000000..f87db622a3a --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.6.kt @@ -0,0 +1,12 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 6 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the packageSimple. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +package `true` diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.6.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.6.txt new file mode 100644 index 00000000000..8fa2d6132aa --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.6.txt @@ -0,0 +1,8 @@ +KtFile: 2.6.kt + PACKAGE_DIRECTIVE + PsiElement(package)('package') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + IMPORT_LIST + \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.7.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.7.kt new file mode 100644 index 00000000000..a91ee870eed --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.7.kt @@ -0,0 +1,15 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 7 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the enumEntry. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +enum class A(x1: Any?) { + `true`("1"), + `false`("2"); +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.7.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.7.txt new file mode 100644 index 00000000000..df236406c4a --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.7.txt @@ -0,0 +1,71 @@ +KtFile: 2.7.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + MODIFIER_LIST + PsiElement(enum)('enum') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x1') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(QUEST)('?') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + ENUM_ENTRY + PsiElement(IDENTIFIER)('`true`') + INITIALIZER_LIST + SUPER_TYPE_CALL_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('1') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(RPAR)(')') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + ENUM_ENTRY + PsiElement(IDENTIFIER)('`false`') + INITIALIZER_LIST + SUPER_TYPE_CALL_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION + + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('2') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(RPAR)(')') + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.8.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.8.kt new file mode 100644 index 00000000000..2c951106dd0 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.8.kt @@ -0,0 +1,18 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 8 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the stringTemplateElement. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +fun f1() { + val x1 = "$`true`" + + val x2 = "..." + "...$`false`..." + "..." + + var x3 = "$`true`$`false`$`true`" +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.8.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.8.txt new file mode 100644 index 00000000000..2ca5167bb67 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.8.txt @@ -0,0 +1,94 @@ +KtFile: 2.8.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f1') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x1') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x2') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + BINARY_EXPRESSION + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('...') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('...') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('...') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('...') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x3') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + SHORT_STRING_TEMPLATE_ENTRY + PsiElement(SHORT_TEMPLATE_ENTRY_START)('$') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.9.kt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.9.kt new file mode 100644 index 00000000000..4cc3c6bb923 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.9.kt @@ -0,0 +1,33 @@ +/* + KOTLIN PSI SPEC TEST (POSITIVE) + + SECTIONS: constant-literals, boolean-literals + PARAGRAPH: 1 + SENTENCE: [2] These are strong keywords which cannot be used as identifiers unless escaped. + NUMBER: 9 + DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the unescapedAnnotation. + NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY! + */ + +class A { + @field:`true` + val a: Int = "" + + @setparam:`false`(`true`) + val b: Int = "" + + @receiver:org.jetbrains.`false`>(`true`) + val c: Int = "" + + @org.jetbrains.`false` + val c: Int = "" + + @`true`, C>(`false`, `true`, `false`) + val c: Int = "" + + @`true` + val c: Int = "" + + @`false`.`true`.`false`, C>(`true`, `false`, `true`) + val c: Int = "" +} diff --git a/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.9.txt b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.9.txt new file mode 100644 index 00000000000..375f01e4893 --- /dev/null +++ b/compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.9.txt @@ -0,0 +1,342 @@ +KtFile: 2.9.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + ANNOTATION_TARGET + PsiElement(field)('field') + PsiElement(COLON)(':') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace('\n ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + ANNOTATION_TARGET + PsiElement(setparam)('setparam') + PsiElement(COLON)(':') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + ANNOTATION_TARGET + PsiElement(receiver)('receiver') + PsiElement(COLON)(':') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('C') + PsiElement(GT)('>') + PsiElement(GT)('>') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('org') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('jetbrains') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiWhiteSpace('\n ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('C') + PsiElement(GT)('>') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiWhiteSpace('\n ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n\n ') + PROPERTY + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(GT)('>') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('C') + PsiElement(GT)('>') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`false`') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`true`') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + PsiElement(CLOSING_QUOTE)('"') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/parsing/ParsingTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/parsing/ParsingTestSpecGenerated.java new file mode 100644 index 00000000000..438ad7d944e --- /dev/null +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/parsing/ParsingTestSpecGenerated.java @@ -0,0 +1,369 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.parsing; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/tests-spec/testData/psi") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class ParsingTestSpecGenerated extends AbstractParsingTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doParsingTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInPsi() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/psi"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true, "helpers", "templates"); + } + + @TestMetadata("compiler/tests-spec/testData/psi/linked") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Linked extends AbstractParsingTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doParsingTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInLinked() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/psi/linked"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/tests-spec/testData/psi/linked/constant-literals") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Constant_literals extends AbstractParsingTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doParsingTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInConstant_literals() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/psi/linked/constant-literals"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Boolean_literals extends AbstractParsingTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doParsingTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInBoolean_literals() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class P_1 extends AbstractParsingTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doParsingTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInP_1() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Neg extends AbstractParsingTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doParsingTest, TargetBackend.ANY, testDataFilePath); + } + + @TestMetadata("2.1.kt") + public void test2_1() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.1.kt"); + } + + @TestMetadata("2.10.kt") + public void test2_10() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.10.kt"); + } + + @TestMetadata("2.11.kt") + public void test2_11() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.11.kt"); + } + + @TestMetadata("2.12.kt") + public void test2_12() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.12.kt"); + } + + @TestMetadata("2.13.kt") + public void test2_13() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.13.kt"); + } + + @TestMetadata("2.14.kt") + public void test2_14() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.14.kt"); + } + + @TestMetadata("2.15.kt") + public void test2_15() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.15.kt"); + } + + @TestMetadata("2.16.kt") + public void test2_16() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.16.kt"); + } + + @TestMetadata("2.17.kt") + public void test2_17() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.17.kt"); + } + + @TestMetadata("2.18.kt") + public void test2_18() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.18.kt"); + } + + @TestMetadata("2.19.kt") + public void test2_19() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.19.kt"); + } + + @TestMetadata("2.2.kt") + public void test2_2() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.2.kt"); + } + + @TestMetadata("2.20.kt") + public void test2_20() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.20.kt"); + } + + @TestMetadata("2.21.kt") + public void test2_21() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.21.kt"); + } + + @TestMetadata("2.22.kt") + public void test2_22() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.22.kt"); + } + + @TestMetadata("2.23.kt") + public void test2_23() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.23.kt"); + } + + @TestMetadata("2.24.kt") + public void test2_24() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.24.kt"); + } + + @TestMetadata("2.25.kt") + public void test2_25() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.25.kt"); + } + + @TestMetadata("2.26.kt") + public void test2_26() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.26.kt"); + } + + @TestMetadata("2.3.kt") + public void test2_3() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.3.kt"); + } + + @TestMetadata("2.4.kt") + public void test2_4() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.4.kt"); + } + + @TestMetadata("2.5.kt") + public void test2_5() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.5.kt"); + } + + @TestMetadata("2.6.kt") + public void test2_6() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.6.kt"); + } + + @TestMetadata("2.7.kt") + public void test2_7() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.7.kt"); + } + + @TestMetadata("2.8.kt") + public void test2_8() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.8.kt"); + } + + @TestMetadata("2.9.kt") + public void test2_9() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg/2.9.kt"); + } + + public void testAllFilesPresentInNeg() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + } + + @TestMetadata("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Pos extends AbstractParsingTestSpec { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doParsingTest, TargetBackend.ANY, testDataFilePath); + } + + @TestMetadata("2.1.kt") + public void test2_1() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.1.kt"); + } + + @TestMetadata("2.10.kt") + public void test2_10() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.10.kt"); + } + + @TestMetadata("2.11.kt") + public void test2_11() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.11.kt"); + } + + @TestMetadata("2.12.kt") + public void test2_12() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.12.kt"); + } + + @TestMetadata("2.13.kt") + public void test2_13() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.13.kt"); + } + + @TestMetadata("2.14.kt") + public void test2_14() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.14.kt"); + } + + @TestMetadata("2.15.kt") + public void test2_15() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.15.kt"); + } + + @TestMetadata("2.16.kt") + public void test2_16() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.16.kt"); + } + + @TestMetadata("2.17.kt") + public void test2_17() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.17.kt"); + } + + @TestMetadata("2.18.kt") + public void test2_18() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.18.kt"); + } + + @TestMetadata("2.19.kt") + public void test2_19() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.19.kt"); + } + + @TestMetadata("2.2.kt") + public void test2_2() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.2.kt"); + } + + @TestMetadata("2.20.kt") + public void test2_20() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.20.kt"); + } + + @TestMetadata("2.21.kt") + public void test2_21() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.21.kt"); + } + + @TestMetadata("2.22.kt") + public void test2_22() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.22.kt"); + } + + @TestMetadata("2.23.kt") + public void test2_23() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.23.kt"); + } + + @TestMetadata("2.24.kt") + public void test2_24() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.24.kt"); + } + + @TestMetadata("2.25.kt") + public void test2_25() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.25.kt"); + } + + @TestMetadata("2.26.kt") + public void test2_26() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.26.kt"); + } + + @TestMetadata("2.3.kt") + public void test2_3() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.3.kt"); + } + + @TestMetadata("2.4.kt") + public void test2_4() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.4.kt"); + } + + @TestMetadata("2.5.kt") + public void test2_5() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.5.kt"); + } + + @TestMetadata("2.6.kt") + public void test2_6() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.6.kt"); + } + + @TestMetadata("2.7.kt") + public void test2_7() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.7.kt"); + } + + @TestMetadata("2.8.kt") + public void test2_8() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.8.kt"); + } + + @TestMetadata("2.9.kt") + public void test2_9() throws Exception { + runTest("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos/2.9.kt"); + } + + public void testAllFilesPresentInPos() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/psi/linked/constant-literals/boolean-literals/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + } + } + } + } + } +} diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/tasks/GenerateSpecTests.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/tasks/GenerateSpecTests.kt index b473e0dcdd1..7cda251ef61 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/tasks/GenerateSpecTests.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/tasks/GenerateSpecTests.kt @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.spec.tasks import org.jetbrains.kotlin.generators.tests.generator.testGroup import org.jetbrains.kotlin.checkers.AbstractDiagnosticsTestSpec +import org.jetbrains.kotlin.parsing.AbstractParsingTestSpec import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TEST_PATH import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTDATA_PATH @@ -15,6 +16,9 @@ fun generateTests() { testClass { model("diagnostics", excludeDirs = listOf("helpers")) } + testClass { + model("psi", testMethod = "doParsingTest", excludeDirs = listOf("helpers", "templates")) + } } }