From de9d1dc53616fdca03980564acc92875b210f330 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Tue, 24 May 2022 10:31:17 +0200 Subject: [PATCH] [Parser] Add additional parsing tests --- .../untilOperatorDifferentContexts.kt | 21 + .../untilOperatorDifferentContexts.txt | 382 ++++++++++++++++++ .../operators/untilOperatorGenericsClash.kt | 5 + .../operators/untilOperatorGenericsClash.txt | 72 ++++ .../psi/operators/untilOperatorGreater.kt | 5 + .../psi/operators/untilOperatorGreater.txt | 107 +++++ .../operators/untilOperatorWithWhitespace.kt | 8 + .../operators/untilOperatorWithWhitespace.txt | 198 +++++++++ .../kotlin/parsing/ParsingTestGenerated.java | 20 + 9 files changed, 818 insertions(+) create mode 100644 compiler/testData/psi/operators/untilOperatorDifferentContexts.kt create mode 100644 compiler/testData/psi/operators/untilOperatorDifferentContexts.txt create mode 100644 compiler/testData/psi/operators/untilOperatorGenericsClash.kt create mode 100644 compiler/testData/psi/operators/untilOperatorGenericsClash.txt create mode 100644 compiler/testData/psi/operators/untilOperatorGreater.kt create mode 100644 compiler/testData/psi/operators/untilOperatorGreater.txt create mode 100644 compiler/testData/psi/operators/untilOperatorWithWhitespace.kt create mode 100644 compiler/testData/psi/operators/untilOperatorWithWhitespace.txt diff --git a/compiler/testData/psi/operators/untilOperatorDifferentContexts.kt b/compiler/testData/psi/operators/untilOperatorDifferentContexts.kt new file mode 100644 index 00000000000..fc23adc06af --- /dev/null +++ b/compiler/testData/psi/operators/untilOperatorDifferentContexts.kt @@ -0,0 +1,21 @@ +fun main() { + 0.. true + n.. true + n+1.. true + n * 2 ..< n * 3 -> true + } +} + +fun main() { + if (0.. + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('main') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('main') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Suppress') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('main') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('main') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + WHEN + PsiElement(when)('when') + PsiWhiteSpace(' ') + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('2') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + WHEN_ENTRY + WHEN_CONDITION_WITH_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(MUL)('*') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('2') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(MUL)('*') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('3') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BOOLEAN_CONSTANT + PsiElement(true)('true') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('main') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + IF + PsiElement(if)('if') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + CONDITION + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + THEN + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + PsiElement(else)('else') + PsiWhiteSpace(' ') + ELSE + IF + PsiElement(if)('if') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + CONDITION + BINARY_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + THEN + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + PsiElement(else)('else') + PsiWhiteSpace(' ') + ELSE + IF + PsiElement(if)('if') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + CONDITION + BINARY_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + THEN + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + PsiElement(else)('else') + PsiWhiteSpace(' ') + ELSE + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace(' ') + BINARY_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_EXPRESSION + BINARY_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_EXPRESSION + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + OPERATION_REFERENCE + PsiElement(PLUS)('+') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + OPERATION_REFERENCE + PsiElement(MINUS)('-') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('3') + OPERATION_REFERENCE + PsiElement(MUL)('*') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiWhiteSpace(' ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/operators/untilOperatorGenericsClash.kt b/compiler/testData/psi/operators/untilOperatorGenericsClash.kt new file mode 100644 index 00000000000..a9362c90b1c --- /dev/null +++ b/compiler/testData/psi/operators/untilOperatorGenericsClash.kt @@ -0,0 +1,5 @@ +fun main() { + val x: .. = 1 + val x = ..::class + val x = `..`::class +} \ No newline at end of file diff --git a/compiler/testData/psi/operators/untilOperatorGenericsClash.txt b/compiler/testData/psi/operators/untilOperatorGenericsClash.txt new file mode 100644 index 00000000000..a3508b5777e --- /dev/null +++ b/compiler/testData/psi/operators/untilOperatorGenericsClash.txt @@ -0,0 +1,72 @@ +KtFile: untilOperatorGenericsClash.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('main') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(RANGE_UNTIL)('..<') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(IDENTIFIER)('Int') + PsiElement(GT)('>') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiErrorElement:Expecting an expression + + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(RANGE_UNTIL)('..<') + PsiElement(IDENTIFIER)('Int') + PsiElement(GT)('>') + PsiElement(COLONCOLON)('::') + PsiElement(class)('class') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CLASS_LITERAL_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`..`') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(GT)('>') + PsiElement(COLONCOLON)('::') + PsiElement(class)('class') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/operators/untilOperatorGreater.kt b/compiler/testData/psi/operators/untilOperatorGreater.kt new file mode 100644 index 00000000000..7bcdb4055ad --- /dev/null +++ b/compiler/testData/psi/operators/untilOperatorGreater.kt @@ -0,0 +1,5 @@ +fun main() { + for (i in 0..>n) {} + for (i in 0 ..> n) {} + for (i in 0.. >n) {} +} \ No newline at end of file diff --git a/compiler/testData/psi/operators/untilOperatorGreater.txt b/compiler/testData/psi/operators/untilOperatorGreater.txt new file mode 100644 index 00000000000..fd0497910bf --- /dev/null +++ b/compiler/testData/psi/operators/untilOperatorGreater.txt @@ -0,0 +1,107 @@ +KtFile: untilOperatorGreater.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('main') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + PsiErrorElement:Expecting an element + PsiElement(GT)('>') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('n') + PsiErrorElement:Expecting an element + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + PsiErrorElement:Expecting an element + PsiElement(GT)('>') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('n') + PsiErrorElement:Expecting an element + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting an element + PsiElement(GT)('>') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('n') + PsiErrorElement:Expecting an element + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/operators/untilOperatorWithWhitespace.kt b/compiler/testData/psi/operators/untilOperatorWithWhitespace.kt new file mode 100644 index 00000000000..19aecf1c24f --- /dev/null +++ b/compiler/testData/psi/operators/untilOperatorWithWhitespace.kt @@ -0,0 +1,8 @@ +fun main() { + for (i in 0.. + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('main') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting an element + PsiElement(LT)('<') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('n') + PsiErrorElement:Expecting an element + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting an element + PsiElement(LT)('<') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('n') + PsiErrorElement:Expecting an element + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE_UNTIL)('..<') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + BINARY_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(RANGE)('..') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting an element + PsiElement(LT)('<') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('n') + PsiErrorElement:Expecting an element + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + DOT_QUALIFIED_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiElement(DOT)('.') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting an element + PsiElement(DOT)('.') + OPERATION_REFERENCE + PsiElement(LT)('<') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FOR + PsiElement(for)('for') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiWhiteSpace(' ') + PsiElement(in)('in') + PsiWhiteSpace(' ') + LOOP_RANGE + BINARY_EXPRESSION + DOT_QUALIFIED_EXPRESSION + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiWhiteSpace(' ') + PsiElement(DOT)('.') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting an element + PsiElement(DOT)('.') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(LT)('<') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BODY + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-gen/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java index c255878695c..ac046886540 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java @@ -1855,6 +1855,26 @@ public class ParsingTestGenerated extends AbstractParsingTest { public void testUntilOperator() throws Exception { runTest("compiler/testData/psi/operators/untilOperator.kt"); } + + @TestMetadata("untilOperatorDifferentContexts.kt") + public void testUntilOperatorDifferentContexts() throws Exception { + runTest("compiler/testData/psi/operators/untilOperatorDifferentContexts.kt"); + } + + @TestMetadata("untilOperatorGenericsClash.kt") + public void testUntilOperatorGenericsClash() throws Exception { + runTest("compiler/testData/psi/operators/untilOperatorGenericsClash.kt"); + } + + @TestMetadata("untilOperatorGreater.kt") + public void testUntilOperatorGreater() throws Exception { + runTest("compiler/testData/psi/operators/untilOperatorGreater.kt"); + } + + @TestMetadata("untilOperatorWithWhitespace.kt") + public void testUntilOperatorWithWhitespace() throws Exception { + runTest("compiler/testData/psi/operators/untilOperatorWithWhitespace.kt"); + } } @TestMetadata("compiler/testData/psi/packages")