diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index d5eb4edefd2..f90d59c0014 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -10655,6 +10655,28 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/expressionAfterTypeReference") + @TestDataPath("$PROJECT_ROOT") + public class ExpressionAfterTypeReference { + @Test + public void testAllFilesPresentInExpressionAfterTypeReference() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/expressionAfterTypeReference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("allowExpressionAfterTypeReference.kt") + public void testAllowExpressionAfterTypeReference() throws Exception { + runTest("compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.kt"); + } + + @Test + @TestMetadata("forbidExpressionAfterTypeReference.kt") + public void testForbidExpressionAfterTypeReference() throws Exception { + runTest("compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/extensions") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 4ff945cb0fe..f103fd89304 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -10655,6 +10655,28 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/expressionAfterTypeReference") + @TestDataPath("$PROJECT_ROOT") + public class ExpressionAfterTypeReference { + @Test + public void testAllFilesPresentInExpressionAfterTypeReference() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/expressionAfterTypeReference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("allowExpressionAfterTypeReference.kt") + public void testAllowExpressionAfterTypeReference() throws Exception { + runTest("compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.kt"); + } + + @Test + @TestMetadata("forbidExpressionAfterTypeReference.kt") + public void testForbidExpressionAfterTypeReference() throws Exception { + runTest("compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/extensions") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index f11eb06d82d..a9575463840 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -10655,6 +10655,28 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/expressionAfterTypeReference") + @TestDataPath("$PROJECT_ROOT") + public class ExpressionAfterTypeReference { + @Test + public void testAllFilesPresentInExpressionAfterTypeReference() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/expressionAfterTypeReference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("allowExpressionAfterTypeReference.kt") + public void testAllowExpressionAfterTypeReference() throws Exception { + runTest("compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.kt"); + } + + @Test + @TestMetadata("forbidExpressionAfterTypeReference.kt") + public void testForbidExpressionAfterTypeReference() throws Exception { + runTest("compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/extensions") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 87da7df9eb1..c68e3974df4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -235,6 +235,8 @@ public interface Errors { DiagnosticFactoryForDeprecation1 PROGRESSIONS_CHANGING_RESOLVE = DiagnosticFactoryForDeprecation1.create(LanguageFeature.ProgressionsChangingResolve); + DiagnosticFactory0 EXPRESSION_AFTER_TYPE_REFERENCE_WITHOUT_SPACING_NOT_ALLOWED = DiagnosticFactory0.create(ERROR); + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Errors in declarations diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index a0d53a9afea..ac2908122b0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -625,6 +625,7 @@ public class DefaultErrorMessages { "This call will resolve to another declaration: {0}. " + "See https://youtrack.jetbrains.com/issue/KT-49276 for more details. " + "Please specify a progression type of argument explicitly through explicit cast to resolve to a proper declaration", COMPACT); + MAP.put(EXPRESSION_AFTER_TYPE_REFERENCE_WITHOUT_SPACING_NOT_ALLOWED, "Expression body directly after type without a whitespace in-between the '>=' is only allowed since version 1.8"); MAP.put(TOO_MANY_ARGUMENTS, "Too many arguments for {0}", FQ_NAMES_IN_TYPES); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/PlatformConfiguratorBase.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/PlatformConfiguratorBase.kt index c099651cf65..1413cd89a09 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/PlatformConfiguratorBase.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/PlatformConfiguratorBase.kt @@ -51,6 +51,7 @@ private val DEFAULT_DECLARATION_CHECKERS = listOf( SubtypingBetweenContextReceiversChecker, ValueParameterUsageInDefaultArgumentChecker, CyclicAnnotationsChecker, + ExpressionAfterTypeParameterWithoutSpacingChecker, ) private val DEFAULT_CALL_CHECKERS = listOf( diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ExpressionAfterTypeParameterWithoutSpacingChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ExpressionAfterTypeParameterWithoutSpacingChecker.kt new file mode 100644 index 00000000000..511d78f0524 --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ExpressionAfterTypeParameterWithoutSpacingChecker.kt @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. + * 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.resolve.checkers + +import com.intellij.psi.PsiElement +import org.jetbrains.kotlin.config.LanguageFeature +import org.jetbrains.kotlin.descriptors.DeclarationDescriptor +import org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor +import org.jetbrains.kotlin.descriptors.PropertySetterDescriptor +import org.jetbrains.kotlin.diagnostics.Errors +import org.jetbrains.kotlin.lexer.KtTokens +import org.jetbrains.kotlin.psi.* + +object ExpressionAfterTypeParameterWithoutSpacingChecker : DeclarationChecker { + + override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) { + if (context.languageVersionSettings.supportsFeature(LanguageFeature.AllowExpressionAfterTypeReferenceWithoutSpacing)) return + when (declaration) { + is KtProperty -> { + if (descriptor is PropertyGetterDescriptor || descriptor is PropertySetterDescriptor) return + check(declaration.typeReference, declaration.initializer, context) + } + is KtFunction -> { + for (valueParameter in declaration.valueParameters) { + check(valueParameter.typeReference, valueParameter.defaultValue, context) + } + + check(declaration.typeReference, declaration.bodyExpression, context) + } + } + } + + private fun check(typeReference: KtTypeReference?, expression: KtExpression?, context: DeclarationCheckerContext) { + if (typeReference == null) return + if (expression == null) return + + val leftSide = typeReference.getRightMostToken() + if (leftSide.node.elementType != KtTokens.GT) return + + val rightSide = typeReference.nextSibling?.getLeftMostToken() ?: return + if (rightSide.node.elementType != KtTokens.EQ) return + + context.trace.report(Errors.EXPRESSION_AFTER_TYPE_REFERENCE_WITHOUT_SPACING_NOT_ALLOWED.on(rightSide)) + } + + private fun PsiElement.getLeftMostToken(): PsiElement { + var current = firstChild ?: return this + while (true) { + current = current.firstChild ?: return current + } + } + + private fun PsiElement.getRightMostToken(): PsiElement { + var current = lastChild ?: return this + while (true) { + current = current.lastChild ?: return current + } + } +} \ No newline at end of file diff --git a/compiler/psi/src/org/jetbrains/kotlin/lexer/Kotlin.flex b/compiler/psi/src/org/jetbrains/kotlin/lexer/Kotlin.flex index def54ab03ce..cbd9c9595a5 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/lexer/Kotlin.flex +++ b/compiler/psi/src/org/jetbrains/kotlin/lexer/Kotlin.flex @@ -283,7 +283,6 @@ LONELY_BACKTICK=` "++" { return KtTokens.PLUSPLUS ; } "--" { return KtTokens.MINUSMINUS; } "<=" { return KtTokens.LTEQ ; } -">=" { return KtTokens.GTEQ ; } "==" { return KtTokens.EQEQ ; } "!=" { return KtTokens.EXCLEQ ; } "&&" { return KtTokens.ANDAND ; } diff --git a/compiler/psi/src/org/jetbrains/kotlin/lexer/_JetLexer.java b/compiler/psi/src/org/jetbrains/kotlin/lexer/_JetLexer.java index 3398e7ccef7..784e1ac231f 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/lexer/_JetLexer.java +++ b/compiler/psi/src/org/jetbrains/kotlin/lexer/_JetLexer.java @@ -119,12 +119,12 @@ class _JetLexer implements FlexLexer { /* The ZZ_CMAP_A table has 3136 entries */ static final char ZZ_CMAP_A[] = zzUnpackCMap( - "\11\0\1\4\1\10\1\102\1\103\1\102\22\0\1\4\1\14\1\31\1\13\1\11\1\71\1\67\1"+ + "\11\0\1\4\1\10\1\102\1\103\1\102\22\0\1\4\1\14\1\31\1\13\1\11\1\70\1\66\1"+ "\26\1\75\1\76\1\40\1\64\1\100\1\25\1\22\1\12\1\15\11\1\1\72\1\77\1\65\1\62"+ - "\1\66\1\63\1\101\1\3\1\17\2\3\1\24\1\23\5\5\1\20\10\5\1\21\2\5\1\16\2\5\1"+ + "\1\71\1\63\1\101\1\3\1\17\2\3\1\24\1\23\5\5\1\20\10\5\1\21\2\5\1\16\2\5\1"+ "\73\1\27\1\74\1\0\1\2\1\7\1\44\1\55\1\51\1\61\1\43\1\50\1\54\1\34\1\35\1\56"+ "\1\53\1\45\1\5\1\46\1\52\1\42\1\5\1\47\1\36\1\33\1\30\1\60\1\57\1\16\1\41"+ - "\1\5\1\32\1\70\1\37\7\0\1\102\24\0\1\5\12\0\1\5\4\0\1\5\5\0\27\5\1\0\12\5"+ + "\1\5\1\32\1\67\1\37\7\0\1\102\24\0\1\5\12\0\1\5\4\0\1\5\5\0\27\5\1\0\12\5"+ "\4\0\14\5\16\0\5\5\7\0\1\5\1\0\1\5\1\0\5\5\1\0\2\5\2\0\4\5\1\0\1\5\6\0\1\5"+ "\1\0\3\5\1\0\1\5\1\0\4\5\1\0\23\5\1\0\13\5\10\0\6\5\1\0\26\5\2\0\1\5\6\0\10"+ "\5\10\0\13\5\5\0\3\5\15\0\12\6\4\0\6\5\1\0\1\5\17\0\2\5\7\0\2\5\12\6\3\5\2"+ @@ -174,7 +174,7 @@ class _JetLexer implements FlexLexer { "\6\0\1\1\1\2\1\3\1\4\1\5\1\1\1\6"+ "\1\7\1\10\1\2\1\11\1\12\1\13\1\14\1\15"+ "\3\3\1\16\1\17\14\3\1\20\1\21\1\22\1\23"+ - "\1\24\1\25\1\1\1\26\1\27\1\30\1\31\1\32"+ + "\1\24\1\1\1\25\1\26\1\27\1\30\1\31\1\32"+ "\1\33\1\34\1\35\1\36\1\37\1\40\1\37\1\1"+ "\1\41\2\37\1\42\1\1\1\42\3\43\1\44\1\45"+ "\2\2\1\0\2\46\1\0\1\47\1\0\1\50\1\51"+ @@ -182,19 +182,18 @@ class _JetLexer implements FlexLexer { "\1\56\1\57\1\60\2\13\1\0\3\3\1\61\1\62"+ "\1\63\1\3\1\64\2\3\1\65\13\3\1\66\1\67"+ "\1\70\1\71\1\72\1\73\1\74\1\75\1\76\1\77"+ - "\1\100\1\101\1\102\1\0\1\103\2\104\2\0\1\42"+ - "\1\105\1\106\1\0\1\107\1\46\1\3\1\0\1\110"+ - "\1\111\1\112\1\113\1\0\1\114\1\115\4\3\1\116"+ - "\4\3\1\117\2\3\1\120\1\3\1\121\6\3\1\122"+ - "\1\123\1\124\2\0\1\125\2\42\1\47\1\126\1\127"+ - "\1\130\2\3\1\131\3\3\1\132\1\133\7\3\1\134"+ - "\1\102\1\0\1\135\1\136\3\3\1\137\2\3\1\140"+ - "\1\141\2\3\1\142\1\143\1\0\1\3\1\144\2\3"+ - "\1\145\1\3\1\146\2\3\1\147\3\3\1\150\1\151"+ - "\1\152"; + "\1\100\1\101\1\0\1\102\2\103\2\0\1\42\1\104"+ + "\1\105\1\0\1\106\1\46\1\3\1\0\1\107\1\110"+ + "\1\111\1\112\1\0\1\113\1\114\4\3\1\115\4\3"+ + "\1\116\2\3\1\117\1\3\1\120\6\3\1\121\1\122"+ + "\1\123\2\0\1\124\2\42\1\47\1\125\1\126\1\127"+ + "\2\3\1\130\3\3\1\131\1\132\7\3\1\133\1\101"+ + "\1\0\1\134\1\135\3\3\1\136\2\3\1\137\1\140"+ + "\2\3\1\141\1\142\1\0\1\3\1\143\2\3\1\144"+ + "\1\3\1\145\2\3\1\146\3\3\1\147\1\150\1\151"; private static int [] zzUnpackAction() { - int [] result = new int[232]; + int [] result = new int[231]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -224,33 +223,33 @@ class _JetLexer implements FlexLexer { "\0\u0440\0\u0484\0\u04c8\0\u050c\0\u0198\0\u0550\0\u0594\0\u05d8"+ "\0\u0198\0\u061c\0\u0660\0\u06a4\0\u06e8\0\u072c\0\u0770\0\u07b4"+ "\0\u07f8\0\u083c\0\u0880\0\u08c4\0\u0908\0\u094c\0\u0990\0\u0198"+ - "\0\u09d4\0\u0a18\0\u0a5c\0\u0aa0\0\u0ae4\0\u0b28\0\u0b6c\0\u0198"+ - "\0\u0198\0\u0198\0\u0198\0\u0bb0\0\u0198\0\u0198\0\u0bf4\0\u0198"+ - "\0\u0c38\0\u0c7c\0\u0198\0\u0198\0\u0cc0\0\u0d04\0\u0d48\0\u0d8c"+ - "\0\u0198\0\u0dd0\0\u0e14\0\u0198\0\u0198\0\u0e58\0\u0e9c\0\u0ee0"+ - "\0\u0198\0\u0f24\0\u0f68\0\u0fac\0\u0ff0\0\u1034\0\u1078\0\u0198"+ - "\0\u10bc\0\u1100\0\u1144\0\u1188\0\u11cc\0\u1210\0\u1254\0\u1298"+ - "\0\u0198\0\u0198\0\u0198\0\u0198\0\u12dc\0\u1320\0\u1364\0\u13a8"+ - "\0\u13ec\0\u0220\0\u1430\0\u0220\0\u1474\0\u0198\0\u14b8\0\u14fc"+ - "\0\u1540\0\u1584\0\u15c8\0\u160c\0\u1650\0\u1694\0\u16d8\0\u171c"+ - "\0\u1760\0\u17a4\0\u17e8\0\u182c\0\u0220\0\u1870\0\u0198\0\u0198"+ - "\0\u0198\0\u0198\0\u0198\0\u0198\0\u0198\0\u0198\0\u0198\0\u0198"+ - "\0\u18b4\0\u18f8\0\u0198\0\u0198\0\u193c\0\u1980\0\u19c4\0\u1a08"+ - "\0\u0198\0\u0198\0\u1a4c\0\u0198\0\u1a90\0\u0198\0\u1ad4\0\u1b18"+ - "\0\u1b5c\0\u1b5c\0\u0198\0\u1ba0\0\u0198\0\u0198\0\u1be4\0\u1c28"+ - "\0\u1c6c\0\u1cb0\0\u0220\0\u1cf4\0\u1d38\0\u1d7c\0\u1dc0\0\u0198"+ - "\0\u1e04\0\u1e48\0\u0220\0\u1e8c\0\u0220\0\u1ed0\0\u1f14\0\u1f58"+ - "\0\u1f9c\0\u1fe0\0\u2024\0\u0220\0\u0220\0\u0198\0\u2068\0\u20ac"+ - "\0\u1980\0\u0198\0\u20f0\0\u0198\0\u0198\0\u0198\0\u0220\0\u2134"+ - "\0\u2178\0\u0220\0\u21bc\0\u2200\0\u2244\0\u0220\0\u0220\0\u2288"+ - "\0\u22cc\0\u2310\0\u2354\0\u2398\0\u23dc\0\u2420\0\u0220\0\u0198"+ - "\0\u2464\0\u0d04\0\u0220\0\u24a8\0\u24ec\0\u2530\0\u0220\0\u2574"+ - "\0\u25b8\0\u0220\0\u0220\0\u25fc\0\u2640\0\u0220\0\u0220\0\u2684"+ - "\0\u26c8\0\u0220\0\u270c\0\u2750\0\u0220\0\u2794\0\u0220\0\u27d8"+ - "\0\u281c\0\u0220\0\u2860\0\u28a4\0\u28e8\0\u0220\0\u0220\0\u0220"; + "\0\u09d4\0\u0a18\0\u0a5c\0\u0aa0\0\u0ae4\0\u0198\0\u0b28\0\u0198"+ + "\0\u0198\0\u0198\0\u0198\0\u0b6c\0\u0198\0\u0198\0\u0bb0\0\u0198"+ + "\0\u0bf4\0\u0c38\0\u0198\0\u0198\0\u0c7c\0\u0cc0\0\u0d04\0\u0d48"+ + "\0\u0198\0\u0d8c\0\u0dd0\0\u0198\0\u0198\0\u0e14\0\u0e58\0\u0e9c"+ + "\0\u0198\0\u0ee0\0\u0f24\0\u0f68\0\u0fac\0\u0ff0\0\u1034\0\u0198"+ + "\0\u1078\0\u10bc\0\u1100\0\u1144\0\u1188\0\u11cc\0\u1210\0\u1254"+ + "\0\u0198\0\u0198\0\u0198\0\u0198\0\u1298\0\u12dc\0\u1320\0\u1364"+ + "\0\u13a8\0\u0220\0\u13ec\0\u0220\0\u1430\0\u0198\0\u1474\0\u14b8"+ + "\0\u14fc\0\u1540\0\u1584\0\u15c8\0\u160c\0\u1650\0\u1694\0\u16d8"+ + "\0\u171c\0\u1760\0\u17a4\0\u17e8\0\u0220\0\u182c\0\u0198\0\u0198"+ + "\0\u0198\0\u0198\0\u0198\0\u0198\0\u0198\0\u0198\0\u0198\0\u1870"+ + "\0\u18b4\0\u0198\0\u0198\0\u18f8\0\u193c\0\u1980\0\u19c4\0\u0198"+ + "\0\u0198\0\u1a08\0\u0198\0\u1a4c\0\u0198\0\u1a90\0\u1ad4\0\u1b18"+ + "\0\u1b18\0\u0198\0\u1b5c\0\u0198\0\u0198\0\u1ba0\0\u1be4\0\u1c28"+ + "\0\u1c6c\0\u0220\0\u1cb0\0\u1cf4\0\u1d38\0\u1d7c\0\u0198\0\u1dc0"+ + "\0\u1e04\0\u0220\0\u1e48\0\u0220\0\u1e8c\0\u1ed0\0\u1f14\0\u1f58"+ + "\0\u1f9c\0\u1fe0\0\u0220\0\u0220\0\u0198\0\u2024\0\u2068\0\u193c"+ + "\0\u0198\0\u20ac\0\u0198\0\u0198\0\u0198\0\u0220\0\u20f0\0\u2134"+ + "\0\u0220\0\u2178\0\u21bc\0\u2200\0\u0220\0\u0220\0\u2244\0\u2288"+ + "\0\u22cc\0\u2310\0\u2354\0\u2398\0\u23dc\0\u0220\0\u0198\0\u2420"+ + "\0\u0cc0\0\u0220\0\u2464\0\u24a8\0\u24ec\0\u0220\0\u2530\0\u2574"+ + "\0\u0220\0\u0220\0\u25b8\0\u25fc\0\u0220\0\u0220\0\u2640\0\u2684"+ + "\0\u0220\0\u26c8\0\u270c\0\u0220\0\u2750\0\u0220\0\u2794\0\u27d8"+ + "\0\u0220\0\u281c\0\u2860\0\u28a4\0\u0220\0\u0220\0\u0220"; private static int [] zzUnpackRowMap() { - int [] result = new int[232]; + int [] result = new int[231]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -306,7 +305,7 @@ class _JetLexer implements FlexLexer { "\1\107\1\110\1\111\1\112\3\0\1\107\12\0\1\112"+ "\1\0\1\106\2\0\1\111\4\0\1\126\27\0\1\127"+ "\13\0\1\127\4\0\1\130\106\0\1\131\34\0\1\132"+ - "\3\0\1\133\15\0\10\23\1\0\15\23\1\134\1\135"+ + "\6\0\1\133\12\0\10\23\1\0\15\23\1\134\1\135"+ "\54\23\31\0\1\136\53\0\3\11\1\0\2\11\6\0"+ "\5\11\1\0\2\11\3\0\1\11\2\0\1\11\1\137"+ "\2\11\2\0\1\140\5\11\1\141\12\11\23\0\3\11"+ @@ -338,186 +337,186 @@ class _JetLexer implements FlexLexer { "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\3\11"+ "\1\164\15\11\23\0\3\11\1\0\2\11\6\0\5\11"+ "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\11\11"+ - "\1\165\7\11\104\0\1\166\3\0\1\167\77\0\1\170"+ - "\1\0\1\171\101\0\1\172\103\0\1\173\110\0\1\174"+ - "\104\0\1\175\75\0\1\176\113\0\1\177\110\0\1\200"+ - "\4\0\10\67\2\0\15\67\1\0\1\67\1\0\52\67"+ - "\2\0\2\201\1\0\1\201\1\0\1\202\6\0\4\201"+ - "\1\0\2\201\3\0\1\201\1\0\1\203\4\201\2\0"+ - "\21\201\22\0\10\204\1\0\17\204\1\205\53\204\31\0"+ - "\1\206\53\0\3\76\1\0\2\76\6\0\5\76\1\0"+ - "\2\76\3\0\1\76\2\0\4\76\2\0\21\76\22\0"+ - "\7\207\2\0\73\207\1\0\3\76\1\0\2\76\6\0"+ - "\5\76\1\0\2\76\3\0\1\76\2\0\1\76\1\210"+ - "\2\76\2\0\21\76\62\0\1\211\55\0\1\212\113\0"+ - "\1\213\101\0\1\106\1\0\1\213\22\0\1\106\37\0"+ - "\1\127\13\0\1\127\4\0\1\214\62\0\2\215\12\0"+ - "\1\215\5\0\1\111\1\0\1\215\22\0\1\111\13\0"+ - "\1\215\17\0\7\113\1\216\1\0\73\113\1\0\3\114"+ - "\1\0\2\114\6\0\5\114\1\0\2\114\3\0\1\114"+ - "\2\0\4\114\2\0\21\114\22\0\7\217\2\0\73\217"+ - "\10\116\1\0\73\116\40\0\1\220\43\0\10\121\1\0"+ - "\73\121\36\0\1\221\7\0\1\222\117\0\1\223\22\0"+ - "\2\124\12\0\1\124\4\0\1\224\1\111\1\112\16\0"+ - "\1\112\4\0\1\111\34\0\3\125\11\0\1\125\1\0"+ - "\1\125\1\106\1\107\1\213\2\125\3\0\1\107\12\0"+ - "\2\125\1\106\2\0\2\125\3\0\1\125\3\0\1\125"+ - "\23\0\2\126\12\0\1\126\2\0\1\106\1\107\1\213"+ - "\5\0\1\107\14\0\1\106\37\0\2\127\12\0\1\127"+ - "\5\0\1\111\1\112\16\0\1\112\4\0\1\111\55\0"+ - "\1\225\61\0\10\23\1\0\73\23\31\0\1\226\53\0"+ + "\1\165\7\11\104\0\1\166\6\0\1\167\74\0\1\170"+ + "\1\0\1\171\101\0\1\172\107\0\1\173\104\0\1\174"+ + "\76\0\1\175\113\0\1\176\110\0\1\177\4\0\10\67"+ + "\2\0\15\67\1\0\1\67\1\0\52\67\2\0\2\200"+ + "\1\0\1\200\1\0\1\201\6\0\4\200\1\0\2\200"+ + "\3\0\1\200\1\0\1\202\4\200\2\0\21\200\22\0"+ + "\10\203\1\0\17\203\1\204\53\203\31\0\1\205\53\0"+ + "\3\76\1\0\2\76\6\0\5\76\1\0\2\76\3\0"+ + "\1\76\2\0\4\76\2\0\21\76\22\0\7\206\2\0"+ + "\73\206\1\0\3\76\1\0\2\76\6\0\5\76\1\0"+ + "\2\76\3\0\1\76\2\0\1\76\1\207\2\76\2\0"+ + "\21\76\62\0\1\210\55\0\1\211\113\0\1\212\101\0"+ + "\1\106\1\0\1\212\22\0\1\106\37\0\1\127\13\0"+ + "\1\127\4\0\1\213\62\0\2\214\12\0\1\214\5\0"+ + "\1\111\1\0\1\214\22\0\1\111\13\0\1\214\17\0"+ + "\7\113\1\215\1\0\73\113\1\0\3\114\1\0\2\114"+ + "\6\0\5\114\1\0\2\114\3\0\1\114\2\0\4\114"+ + "\2\0\21\114\22\0\7\216\2\0\73\216\10\116\1\0"+ + "\73\116\40\0\1\217\43\0\10\121\1\0\73\121\36\0"+ + "\1\220\7\0\1\221\117\0\1\222\22\0\2\124\12\0"+ + "\1\124\4\0\1\223\1\111\1\112\16\0\1\112\4\0"+ + "\1\111\34\0\3\125\11\0\1\125\1\0\1\125\1\106"+ + "\1\107\1\212\2\125\3\0\1\107\12\0\2\125\1\106"+ + "\2\0\2\125\3\0\1\125\3\0\1\125\23\0\2\126"+ + "\12\0\1\126\2\0\1\106\1\107\1\212\5\0\1\107"+ + "\14\0\1\106\37\0\2\127\12\0\1\127\5\0\1\111"+ + "\1\112\16\0\1\112\4\0\1\111\55\0\1\224\61\0"+ + "\10\23\1\0\73\23\31\0\1\225\53\0\3\11\1\0"+ + "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ + "\2\11\1\226\1\11\2\0\6\11\1\227\12\11\23\0"+ "\3\11\1\0\2\11\6\0\5\11\1\0\2\11\3\0"+ - "\1\11\2\0\2\11\1\227\1\11\2\0\6\11\1\230"+ - "\12\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ - "\2\11\3\0\1\11\2\0\4\11\2\0\1\11\1\231"+ - "\17\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ - "\2\11\3\0\1\232\2\0\4\11\2\0\1\233\20\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\11\2\0\1\234\3\11\2\0\21\11\23\0"+ + "\1\11\2\0\4\11\2\0\1\11\1\230\17\11\23\0"+ "\3\11\1\0\2\11\6\0\5\11\1\0\2\11\3\0"+ - "\1\11\2\0\4\11\2\0\1\11\1\235\17\11\23\0"+ - "\3\11\1\0\2\11\6\0\5\11\1\0\2\11\3\0"+ - "\1\11\2\0\4\11\2\0\10\11\1\236\10\11\23\0"+ - "\3\11\1\0\2\11\6\0\5\11\1\0\2\11\3\0"+ - "\1\11\2\0\3\11\1\237\2\0\21\11\23\0\3\11"+ + "\1\231\2\0\4\11\2\0\1\232\20\11\23\0\3\11"+ "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ - "\2\0\4\11\2\0\21\11\1\0\1\240\21\0\3\11"+ - "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ - "\2\0\4\11\2\0\4\11\1\241\14\11\23\0\3\11"+ - "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ - "\2\0\1\242\3\11\2\0\21\11\23\0\3\11\1\0"+ + "\2\0\1\233\3\11\2\0\21\11\23\0\3\11\1\0"+ "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\4\11\2\0\5\11\1\243\13\11\23\0\3\11\1\0"+ + "\4\11\2\0\1\11\1\234\17\11\23\0\3\11\1\0"+ "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\4\11\2\0\4\11\1\244\14\11\23\0\3\11\1\0"+ + "\4\11\2\0\10\11\1\235\10\11\23\0\3\11\1\0"+ "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\4\11\2\0\6\11\1\245\12\11\23\0\3\11\1\0"+ - "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\4\11\2\0\3\11\1\246\15\11\23\0\3\11\1\0"+ - "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\4\11\2\0\5\11\1\247\13\11\23\0\3\11\1\0"+ - "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\4\11\2\0\15\11\1\250\3\11\23\0\3\11\1\0"+ - "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\4\11\2\0\2\11\1\251\16\11\23\0\3\11\1\0"+ - "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\2\11\1\252\1\11\2\0\2\11\1\253\16\11\23\0"+ - "\3\11\1\0\2\11\6\0\5\11\1\0\2\11\3\0"+ - "\1\11\2\0\4\11\2\0\4\11\1\254\1\11\1\255"+ - "\12\11\104\0\1\256\22\0\3\201\1\0\2\201\6\0"+ - "\5\201\1\0\2\201\3\0\1\201\2\0\4\201\2\0"+ - "\21\201\22\0\7\257\2\0\73\257\1\0\1\260\1\0"+ - "\1\260\11\0\1\260\1\0\1\260\3\0\2\260\16\0"+ - "\2\260\3\0\2\260\3\0\1\260\3\0\1\260\53\0"+ - "\1\261\52\0\7\207\1\262\1\0\73\207\1\0\3\76"+ - "\1\0\2\76\6\0\5\76\1\0\2\76\3\0\1\76"+ - "\2\0\2\76\1\263\1\76\2\0\21\76\44\0\1\214"+ - "\62\0\2\215\12\0\1\215\5\0\1\111\24\0\1\111"+ - "\33\0\7\217\1\264\1\0\73\217\12\0\1\265\72\0"+ - "\3\266\1\0\2\266\6\0\5\266\1\0\2\266\3\0"+ - "\1\266\2\0\4\266\2\0\21\266\23\0\1\127\13\0"+ - "\1\127\67\0\3\11\1\0\2\11\6\0\5\11\1\0"+ - "\2\11\3\0\1\11\2\0\3\11\1\267\2\0\21\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\11\2\0\4\11\2\0\11\11\1\270\7\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\11\2\0\4\11\2\0\2\11\1\271\16\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\11\2\0\4\11\2\0\2\11\1\272\16\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\11\2\0\4\11\2\0\2\11\1\273\16\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\11\2\0\4\11\2\0\2\11\1\274\16\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\11\2\0\4\11\2\0\12\11\1\275\6\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\11\2\0\4\11\2\0\2\11\1\276\16\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\11\2\0\4\11\2\0\4\11\1\277\14\11"+ - "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ - "\3\0\1\300\2\0\4\11\2\0\21\11\23\0\3\11"+ - "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ - "\2\0\3\11\1\301\2\0\21\11\23\0\3\11\1\0"+ - "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\3\11\1\302\2\0\21\11\23\0\3\11\1\0\2\11"+ - "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\1\303"+ + "\3\11\1\236\2\0\21\11\23\0\3\11\1\0\2\11"+ + "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\4\11"+ + "\2\0\21\11\1\0\1\237\21\0\3\11\1\0\2\11"+ + "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\4\11"+ + "\2\0\4\11\1\240\14\11\23\0\3\11\1\0\2\11"+ + "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\1\241"+ "\3\11\2\0\21\11\23\0\3\11\1\0\2\11\6\0"+ "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\2\11\1\304\16\11\23\0\3\11\1\0\2\11\6\0"+ + "\5\11\1\242\13\11\23\0\3\11\1\0\2\11\6\0"+ "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\3\11\1\305\15\11\23\0\3\11\1\0\2\11\6\0"+ + "\4\11\1\243\14\11\23\0\3\11\1\0\2\11\6\0"+ "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\4\11\1\306\14\11\23\0\3\11\1\0\2\11\6\0"+ + "\6\11\1\244\12\11\23\0\3\11\1\0\2\11\6\0"+ "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\5\11\1\307\13\11\22\0\7\257\1\310\1\0\73\257"+ - "\1\0\1\311\1\0\1\311\11\0\1\311\1\0\1\311"+ - "\3\0\2\311\16\0\2\311\3\0\2\311\3\0\1\311"+ - "\3\0\1\311\23\0\3\76\1\0\2\76\6\0\5\76"+ - "\1\0\2\76\3\0\1\76\2\0\3\76\1\312\2\0"+ - "\21\76\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ - "\2\11\3\0\1\11\2\0\4\11\2\0\16\11\1\313"+ - "\2\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ - "\2\11\3\0\1\11\2\0\4\11\2\0\3\11\1\314"+ - "\5\11\1\315\7\11\23\0\3\11\1\0\2\11\6\0"+ + "\3\11\1\245\15\11\23\0\3\11\1\0\2\11\6\0"+ "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\6\11\1\316\12\11\23\0\3\11\1\0\2\11\6\0"+ + "\5\11\1\246\13\11\23\0\3\11\1\0\2\11\6\0"+ "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\6\11\1\317\12\11\23\0\3\11\1\0\2\11\6\0"+ + "\15\11\1\247\3\11\23\0\3\11\1\0\2\11\6\0"+ "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\3\11\1\320\15\11\23\0\3\11\1\0\2\11\6\0"+ - "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\6\11\1\321\12\11\23\0\3\11\1\0\2\11\6\0"+ - "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\2\11\1\322\16\11\23\0\3\11\1\0\2\11\6\0"+ - "\5\11\1\0\2\11\3\0\1\11\2\0\3\11\1\323"+ - "\2\0\21\11\23\0\3\11\1\0\2\11\6\0\5\11"+ - "\1\0\2\11\3\0\1\11\2\0\2\11\1\324\1\11"+ - "\2\0\21\11\23\0\3\11\1\0\2\11\6\0\5\11"+ - "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\10\11"+ - "\1\325\10\11\23\0\3\11\1\0\2\11\6\0\5\11"+ - "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\12\11"+ - "\1\326\6\11\23\0\3\11\1\0\2\11\6\0\5\11"+ - "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\2\11"+ - "\1\327\16\11\23\0\1\330\1\0\1\330\11\0\1\330"+ - "\1\0\1\330\3\0\2\330\16\0\2\330\3\0\2\330"+ - "\3\0\1\330\3\0\1\330\23\0\3\11\1\0\2\11"+ - "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\4\11"+ - "\2\0\4\11\1\331\14\11\23\0\3\11\1\0\2\11"+ - "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\4\11"+ - "\2\0\7\11\1\332\11\11\23\0\3\11\1\0\2\11"+ - "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\4\11"+ - "\2\0\7\11\1\333\11\11\23\0\3\11\1\0\2\11"+ - "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\4\11"+ - "\2\0\13\11\1\334\5\11\23\0\3\11\1\0\2\11"+ - "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\4\11"+ - "\2\0\5\11\1\335\13\11\23\0\3\11\1\0\2\11"+ - "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\4\11"+ - "\2\0\5\11\1\336\13\11\23\0\3\11\1\0\2\11"+ - "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\1\337"+ - "\3\11\2\0\21\11\23\0\1\204\1\0\1\204\11\0"+ - "\1\204\1\0\1\204\3\0\2\204\16\0\2\204\3\0"+ - "\2\204\3\0\1\204\3\0\1\204\23\0\3\11\1\0"+ + "\2\11\1\250\16\11\23\0\3\11\1\0\2\11\6\0"+ + "\5\11\1\0\2\11\3\0\1\11\2\0\2\11\1\251"+ + "\1\11\2\0\2\11\1\252\16\11\23\0\3\11\1\0"+ "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\2\11\1\340\1\11\2\0\21\11\23\0\3\11\1\0"+ - "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\4\11\2\0\3\11\1\341\15\11\23\0\3\11\1\0"+ - "\2\11\6\0\5\11\1\0\2\11\3\0\1\11\2\0"+ - "\4\11\2\0\2\11\1\342\16\11\23\0\3\11\1\0"+ - "\2\11\6\0\5\11\1\0\2\11\3\0\1\343\2\0"+ - "\4\11\2\0\21\11\23\0\3\11\1\0\2\11\6\0"+ - "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\3\11\1\344\15\11\23\0\3\11\1\0\2\11\6\0"+ - "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\10\11\1\345\10\11\23\0\3\11\1\0\2\11\6\0"+ - "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ - "\2\11\1\346\16\11\23\0\3\11\1\0\2\11\6\0"+ - "\5\11\1\0\2\11\3\0\1\11\2\0\3\11\1\347"+ + "\4\11\2\0\4\11\1\253\1\11\1\254\12\11\104\0"+ + "\1\255\22\0\3\200\1\0\2\200\6\0\5\200\1\0"+ + "\2\200\3\0\1\200\2\0\4\200\2\0\21\200\22\0"+ + "\7\256\2\0\73\256\1\0\1\257\1\0\1\257\11\0"+ + "\1\257\1\0\1\257\3\0\2\257\16\0\2\257\3\0"+ + "\2\257\3\0\1\257\3\0\1\257\53\0\1\260\52\0"+ + "\7\206\1\261\1\0\73\206\1\0\3\76\1\0\2\76"+ + "\6\0\5\76\1\0\2\76\3\0\1\76\2\0\2\76"+ + "\1\262\1\76\2\0\21\76\44\0\1\213\62\0\2\214"+ + "\12\0\1\214\5\0\1\111\24\0\1\111\33\0\7\216"+ + "\1\263\1\0\73\216\12\0\1\264\72\0\3\265\1\0"+ + "\2\265\6\0\5\265\1\0\2\265\3\0\1\265\2\0"+ + "\4\265\2\0\21\265\23\0\1\127\13\0\1\127\67\0"+ + "\3\11\1\0\2\11\6\0\5\11\1\0\2\11\3\0"+ + "\1\11\2\0\3\11\1\266\2\0\21\11\23\0\3\11"+ + "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ + "\2\0\4\11\2\0\11\11\1\267\7\11\23\0\3\11"+ + "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ + "\2\0\4\11\2\0\2\11\1\270\16\11\23\0\3\11"+ + "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ + "\2\0\4\11\2\0\2\11\1\271\16\11\23\0\3\11"+ + "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ + "\2\0\4\11\2\0\2\11\1\272\16\11\23\0\3\11"+ + "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ + "\2\0\4\11\2\0\2\11\1\273\16\11\23\0\3\11"+ + "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ + "\2\0\4\11\2\0\12\11\1\274\6\11\23\0\3\11"+ + "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ + "\2\0\4\11\2\0\2\11\1\275\16\11\23\0\3\11"+ + "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\11"+ + "\2\0\4\11\2\0\4\11\1\276\14\11\23\0\3\11"+ + "\1\0\2\11\6\0\5\11\1\0\2\11\3\0\1\277"+ + "\2\0\4\11\2\0\21\11\23\0\3\11\1\0\2\11"+ + "\6\0\5\11\1\0\2\11\3\0\1\11\2\0\3\11"+ + "\1\300\2\0\21\11\23\0\3\11\1\0\2\11\6\0"+ + "\5\11\1\0\2\11\3\0\1\11\2\0\3\11\1\301"+ "\2\0\21\11\23\0\3\11\1\0\2\11\6\0\5\11"+ - "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\2\11"+ - "\1\350\16\11\22\0"; + "\1\0\2\11\3\0\1\11\2\0\1\302\3\11\2\0"+ + "\21\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\2\11\1\303"+ + "\16\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\3\11\1\304"+ + "\15\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\4\11\1\305"+ + "\14\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\5\11\1\306"+ + "\13\11\22\0\7\256\1\307\1\0\73\256\1\0\1\310"+ + "\1\0\1\310\11\0\1\310\1\0\1\310\3\0\2\310"+ + "\16\0\2\310\3\0\2\310\3\0\1\310\3\0\1\310"+ + "\23\0\3\76\1\0\2\76\6\0\5\76\1\0\2\76"+ + "\3\0\1\76\2\0\3\76\1\311\2\0\21\76\23\0"+ + "\3\11\1\0\2\11\6\0\5\11\1\0\2\11\3\0"+ + "\1\11\2\0\4\11\2\0\16\11\1\312\2\11\23\0"+ + "\3\11\1\0\2\11\6\0\5\11\1\0\2\11\3\0"+ + "\1\11\2\0\4\11\2\0\3\11\1\313\5\11\1\314"+ + "\7\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\6\11\1\315"+ + "\12\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\6\11\1\316"+ + "\12\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\3\11\1\317"+ + "\15\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\6\11\1\320"+ + "\12\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\2\11\1\321"+ + "\16\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\3\11\1\322\2\0\21\11"+ + "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ + "\3\0\1\11\2\0\2\11\1\323\1\11\2\0\21\11"+ + "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ + "\3\0\1\11\2\0\4\11\2\0\10\11\1\324\10\11"+ + "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ + "\3\0\1\11\2\0\4\11\2\0\12\11\1\325\6\11"+ + "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ + "\3\0\1\11\2\0\4\11\2\0\2\11\1\326\16\11"+ + "\23\0\1\327\1\0\1\327\11\0\1\327\1\0\1\327"+ + "\3\0\2\327\16\0\2\327\3\0\2\327\3\0\1\327"+ + "\3\0\1\327\23\0\3\11\1\0\2\11\6\0\5\11"+ + "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\4\11"+ + "\1\330\14\11\23\0\3\11\1\0\2\11\6\0\5\11"+ + "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\7\11"+ + "\1\331\11\11\23\0\3\11\1\0\2\11\6\0\5\11"+ + "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\7\11"+ + "\1\332\11\11\23\0\3\11\1\0\2\11\6\0\5\11"+ + "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\13\11"+ + "\1\333\5\11\23\0\3\11\1\0\2\11\6\0\5\11"+ + "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\5\11"+ + "\1\334\13\11\23\0\3\11\1\0\2\11\6\0\5\11"+ + "\1\0\2\11\3\0\1\11\2\0\4\11\2\0\5\11"+ + "\1\335\13\11\23\0\3\11\1\0\2\11\6\0\5\11"+ + "\1\0\2\11\3\0\1\11\2\0\1\336\3\11\2\0"+ + "\21\11\23\0\1\203\1\0\1\203\11\0\1\203\1\0"+ + "\1\203\3\0\2\203\16\0\2\203\3\0\2\203\3\0"+ + "\1\203\3\0\1\203\23\0\3\11\1\0\2\11\6\0"+ + "\5\11\1\0\2\11\3\0\1\11\2\0\2\11\1\337"+ + "\1\11\2\0\21\11\23\0\3\11\1\0\2\11\6\0"+ + "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ + "\3\11\1\340\15\11\23\0\3\11\1\0\2\11\6\0"+ + "\5\11\1\0\2\11\3\0\1\11\2\0\4\11\2\0"+ + "\2\11\1\341\16\11\23\0\3\11\1\0\2\11\6\0"+ + "\5\11\1\0\2\11\3\0\1\342\2\0\4\11\2\0"+ + "\21\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\3\11\1\343"+ + "\15\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\10\11\1\344"+ + "\10\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\4\11\2\0\2\11\1\345"+ + "\16\11\23\0\3\11\1\0\2\11\6\0\5\11\1\0"+ + "\2\11\3\0\1\11\2\0\3\11\1\346\2\0\21\11"+ + "\23\0\3\11\1\0\2\11\6\0\5\11\1\0\2\11"+ + "\3\0\1\11\2\0\4\11\2\0\2\11\1\347\16\11"+ + "\22\0"; private static int [] zzUnpackTrans() { - int [] result = new int[10540]; + int [] result = new int[10472]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -556,17 +555,18 @@ class _JetLexer implements FlexLexer { private static final String ZZ_ATTRIBUTE_PACKED_0 = "\6\0\1\11\15\1\1\11\3\1\1\11\16\1\1\11"+ - "\7\1\4\11\1\1\2\11\1\1\1\11\2\1\2\11"+ - "\4\1\1\11\2\1\2\11\2\1\1\0\1\11\1\1"+ - "\1\0\1\1\1\0\2\1\1\11\1\1\1\0\1\1"+ - "\1\0\4\1\4\11\1\1\1\0\7\1\1\11\20\1"+ - "\12\11\1\1\1\0\2\11\1\1\2\0\1\1\2\11"+ - "\1\0\1\11\1\1\1\11\1\0\3\1\1\11\1\0"+ - "\2\11\11\1\1\11\15\1\1\11\2\0\1\1\1\11"+ - "\1\1\3\11\21\1\1\11\1\0\16\1\1\0\20\1"; + "\5\1\1\11\1\1\4\11\1\1\2\11\1\1\1\11"+ + "\2\1\2\11\4\1\1\11\2\1\2\11\2\1\1\0"+ + "\1\11\1\1\1\0\1\1\1\0\2\1\1\11\1\1"+ + "\1\0\1\1\1\0\4\1\4\11\1\1\1\0\7\1"+ + "\1\11\20\1\11\11\1\1\1\0\2\11\1\1\2\0"+ + "\1\1\2\11\1\0\1\11\1\1\1\11\1\0\3\1"+ + "\1\11\1\0\2\11\11\1\1\11\15\1\1\11\2\0"+ + "\1\1\1\11\1\1\3\11\21\1\1\11\1\0\16\1"+ + "\1\0\20\1"; private static int [] zzUnpackAttribute() { - int [] result = new int[232]; + int [] result = new int[231]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -719,7 +719,7 @@ class _JetLexer implements FlexLexer { /** * Refills the input buffer. * - * @return false, iff there was new input. + * @return {@code false}, iff there was new input. * * @exception java.io.IOException if any I/O-Error occurs */ @@ -755,7 +755,7 @@ class _JetLexer implements FlexLexer { /** - * Returns the character at position pos from the + * Returns the character at position {@code pos} from the * matched text. * * It is equivalent to yytext().charAt(pos), but faster @@ -928,14 +928,14 @@ class _JetLexer implements FlexLexer { zzStartRead = commentStart; return commentStateToTokenType(state); } // fall though - case 233: break; + case 232: break; case DOC_COMMENT: { int state = yystate(); popState(); zzStartRead = commentStart; return commentStateToTokenType(state); } // fall though - case 234: break; + case 233: break; default: return null; } @@ -946,182 +946,182 @@ class _JetLexer implements FlexLexer { { return TokenType.BAD_CHARACTER; } // fall through - case 107: break; + case 106: break; case 2: { return KtTokens.INTEGER_LITERAL; } // fall through - case 108: break; + case 107: break; case 3: { return KtTokens.IDENTIFIER; } // fall through - case 109: break; + case 108: break; case 4: { return KtTokens.WHITE_SPACE; } // fall through - case 110: break; + case 109: break; case 5: { pushState(UNMATCHED_BACKTICK); return TokenType.BAD_CHARACTER; } // fall through - case 111: break; + case 110: break; case 6: { return KtTokens.DIV ; } // fall through - case 112: break; + case 111: break; case 7: { return KtTokens.HASH ; } // fall through - case 113: break; + case 112: break; case 8: { return KtTokens.EXCL ; } // fall through - case 114: break; + case 113: break; case 9: { return KtTokens.DOT ; } // fall through - case 115: break; + case 114: break; case 10: { return KtTokens.MINUS ; } // fall through - case 116: break; + case 115: break; case 11: { return KtTokens.CHARACTER_LITERAL; } // fall through - case 117: break; + case 116: break; case 12: { pushState(STRING); return KtTokens.OPEN_QUOTE; } // fall through - case 118: break; + case 117: break; case 13: { return KtTokens.LBRACE ; } // fall through - case 119: break; + case 118: break; case 14: { return KtTokens.RBRACE ; } // fall through - case 120: break; + case 119: break; case 15: { return KtTokens.MUL ; } // fall through - case 121: break; + case 120: break; case 16: { return KtTokens.EQ ; } // fall through - case 122: break; + case 121: break; case 17: { return KtTokens.QUEST ; } // fall through - case 123: break; + case 122: break; case 18: { return KtTokens.PLUS ; } // fall through - case 124: break; + case 123: break; case 19: { return KtTokens.LT ; } // fall through - case 125: break; + case 124: break; case 20: - { return KtTokens.GT ; - } - // fall through - case 126: break; - case 21: { return KtTokens.AND ; } // fall through - case 127: break; - case 22: + case 125: break; + case 21: { return KtTokens.PERC ; } // fall through - case 128: break; + case 126: break; + case 22: + { return KtTokens.GT ; + } + // fall through + case 127: break; case 23: { return KtTokens.COLON ; } // fall through - case 129: break; + case 128: break; case 24: { return KtTokens.LBRACKET ; } // fall through - case 130: break; + case 129: break; case 25: { return KtTokens.RBRACKET ; } // fall through - case 131: break; + case 130: break; case 26: { return KtTokens.LPAR ; } // fall through - case 132: break; + case 131: break; case 27: { return KtTokens.RPAR ; } // fall through - case 133: break; + case 132: break; case 28: { return KtTokens.SEMICOLON ; } // fall through - case 134: break; + case 133: break; case 29: { return KtTokens.COMMA ; } // fall through - case 135: break; + case 134: break; case 30: { return KtTokens.AT ; } // fall through - case 136: break; + case 135: break; case 31: { return KtTokens.REGULAR_STRING_PART; } // fall through - case 137: break; + case 136: break; case 32: { popState(); yypushback(1); return KtTokens.DANGLING_NEWLINE; } // fall through - case 138: break; + case 137: break; case 33: { popState(); return KtTokens.CLOSING_QUOTE; } // fall through - case 139: break; + case 138: break; case 34: { popState(); return KtTokens.IDENTIFIER; } // fall through - case 140: break; + case 139: break; case 35: { } // fall through - case 141: break; + case 140: break; case 36: { lBraceCount++; return KtTokens.LBRACE; } // fall through - case 142: break; + case 141: break; case 37: { if (lBraceCount == 0) { popState(); @@ -1131,34 +1131,34 @@ class _JetLexer implements FlexLexer { return KtTokens.RBRACE; } // fall through - case 143: break; + case 142: break; case 38: { return KtTokens.FLOAT_LITERAL; } // fall through - case 144: break; + case 143: break; case 39: { return KtTokens.FIELD_IDENTIFIER; } // fall through - case 145: break; + case 144: break; case 40: { return KtTokens.EOL_COMMENT; } // fall through - case 146: break; + case 145: break; case 41: { pushState(BLOCK_COMMENT); commentDepth = 0; commentStart = getTokenStart(); } // fall through - case 147: break; + case 146: break; case 42: { return KtTokens.DIVEQ ; } // fall through - case 148: break; + case 147: break; case 43: { if (zzCurrentPos == 0) { return KtTokens.SHEBANG_COMMENT; @@ -1169,140 +1169,135 @@ class _JetLexer implements FlexLexer { } } // fall through - case 149: break; + case 148: break; case 44: { return KtTokens.EXCLEQ ; } // fall through - case 150: break; + case 149: break; case 45: { return KtTokens.RANGE ; } // fall through - case 151: break; + case 150: break; case 46: { return KtTokens.MINUSMINUS; } // fall through - case 152: break; + case 151: break; case 47: { return KtTokens.MINUSEQ ; } // fall through - case 153: break; + case 152: break; case 48: { return KtTokens.ARROW ; } // fall through - case 154: break; + case 153: break; case 49: { return KtTokens.IS_KEYWORD ; } // fall through - case 155: break; + case 154: break; case 50: { return KtTokens.IN_KEYWORD ; } // fall through - case 156: break; + case 155: break; case 51: { return KtTokens.IF_KEYWORD ; } // fall through - case 157: break; + case 156: break; case 52: { return KtTokens.MULTEQ ; } // fall through - case 158: break; + case 157: break; case 53: { return KtTokens.AS_KEYWORD ; } // fall through - case 159: break; + case 158: break; case 54: { return KtTokens.DO_KEYWORD ; } // fall through - case 160: break; + case 159: break; case 55: { return KtTokens.EQEQ ; } // fall through - case 161: break; + case 160: break; case 56: { return KtTokens.DOUBLE_ARROW; } // fall through - case 162: break; + case 161: break; case 57: { return KtTokens.PLUSEQ ; } // fall through - case 163: break; + case 162: break; case 58: { return KtTokens.PLUSPLUS ; } // fall through - case 164: break; + case 163: break; case 59: { return KtTokens.LTEQ ; } // fall through - case 165: break; + case 164: break; case 60: - { return KtTokens.GTEQ ; - } - // fall through - case 166: break; - case 61: { return KtTokens.ANDAND ; } // fall through - case 167: break; - case 62: + case 165: break; + case 61: { return KtTokens.OROR ; } // fall through - case 168: break; - case 63: + case 166: break; + case 62: { return KtTokens.PERCEQ ; } // fall through - case 169: break; - case 64: + case 167: break; + case 63: { return KtTokens.COLONCOLON; } // fall through - case 170: break; - case 65: + case 168: break; + case 64: { return KtTokens.DOUBLE_SEMICOLON; } // fall through - case 171: break; - case 66: + case 169: break; + case 65: { pushState(SHORT_TEMPLATE_ENTRY); yypushback(yylength() - 1); return KtTokens.SHORT_TEMPLATE_ENTRY_START; } // fall through - case 172: break; - case 67: + case 170: break; + case 66: { pushState(LONG_TEMPLATE_ENTRY); return KtTokens.LONG_TEMPLATE_ENTRY_START; } // fall through - case 173: break; - case 68: + case 171: break; + case 67: { return KtTokens.ESCAPE_SEQUENCE; } // fall through - case 174: break; - case 69: + case 172: break; + case 68: { commentDepth++; } // fall through - case 175: break; - case 70: + case 173: break; + case 69: { if (commentDepth > 0) { commentDepth--; } @@ -1314,80 +1309,80 @@ class _JetLexer implements FlexLexer { } } // fall through - case 176: break; - case 71: + case 174: break; + case 70: { yypushback(2); return KtTokens.INTEGER_LITERAL; } // fall through - case 177: break; - case 72: + case 175: break; + case 71: { pushState(DOC_COMMENT); commentDepth = 0; commentStart = getTokenStart(); } // fall through - case 178: break; - case 73: + case 176: break; + case 72: { return KtTokens.NOT_IS; } // fall through - case 179: break; - case 74: + case 177: break; + case 73: { return KtTokens.NOT_IN; } // fall through - case 180: break; - case 75: + case 178: break; + case 74: { return KtTokens.EXCLEQEQEQ; } // fall through - case 181: break; - case 76: + case 179: break; + case 75: { return KtTokens.RESERVED ; } // fall through - case 182: break; - case 77: + case 180: break; + case 76: { pushState(RAW_STRING); return KtTokens.OPEN_QUOTE; } // fall through - case 183: break; - case 78: + case 181: break; + case 77: { return KtTokens.TRY_KEYWORD ; } // fall through - case 184: break; - case 79: + case 182: break; + case 78: { return KtTokens.AS_SAFE; } // fall through - case 185: break; - case 80: + case 183: break; + case 79: { return KtTokens.FUN_KEYWORD ; } // fall through - case 186: break; - case 81: + case 184: break; + case 80: { return KtTokens.FOR_KEYWORD ; } // fall through - case 187: break; - case 82: + case 185: break; + case 81: { return KtTokens.VAL_KEYWORD ; } // fall through - case 188: break; - case 83: + case 186: break; + case 82: { return KtTokens.VAR_KEYWORD ; } // fall through - case 189: break; - case 84: + case 187: break; + case 83: { return KtTokens.EQEQEQ ; } // fall through - case 190: break; - case 85: + case 188: break; + case 84: { int length = yytext().length(); if (length <= 3) { // closing """ popState(); @@ -1399,112 +1394,112 @@ class _JetLexer implements FlexLexer { } } // fall through - case 191: break; - case 86: + case 189: break; + case 85: { return KtTokens.BLOCK_COMMENT; } // fall through - case 192: break; - case 87: + case 190: break; + case 86: { yypushback(3); return KtTokens.EXCL; } // fall through - case 193: break; - case 88: + case 191: break; + case 87: { return KtTokens.THIS_KEYWORD ; } // fall through - case 194: break; - case 89: + case 192: break; + case 88: { return KtTokens.TRUE_KEYWORD ; } // fall through - case 195: break; - case 90: + case 193: break; + case 89: { return KtTokens.ELSE_KEYWORD ; } // fall through - case 196: break; - case 91: + case 194: break; + case 90: { return KtTokens.NULL_KEYWORD ; } // fall through - case 197: break; - case 92: + case 195: break; + case 91: { return KtTokens.WHEN_KEYWORD ; } // fall through - case 198: break; - case 93: + case 196: break; + case 92: { popState(); return KtTokens.THIS_KEYWORD; } // fall through - case 199: break; - case 94: + case 197: break; + case 93: { return KtTokens.THROW_KEYWORD ; } // fall through - case 200: break; - case 95: + case 198: break; + case 94: { return KtTokens.SUPER_KEYWORD ; } // fall through - case 201: break; - case 96: + case 199: break; + case 95: { return KtTokens.FALSE_KEYWORD ; } // fall through - case 202: break; - case 97: + case 200: break; + case 96: { return KtTokens.CLASS_KEYWORD ; } // fall through - case 203: break; - case 98: + case 201: break; + case 97: { return KtTokens.BREAK_KEYWORD ; } // fall through - case 204: break; - case 99: + case 202: break; + case 98: { return KtTokens.WHILE_KEYWORD ; } // fall through - case 205: break; - case 100: + case 203: break; + case 99: { return KtTokens.TYPEOF_KEYWORD ; } // fall through - case 206: break; - case 101: + case 204: break; + case 100: { return KtTokens.RETURN_KEYWORD ; } // fall through - case 207: break; - case 102: + case 205: break; + case 101: { return KtTokens.OBJECT_KEYWORD ; } // fall through - case 208: break; - case 103: + case 206: break; + case 102: { return KtTokens.PACKAGE_KEYWORD ; } // fall through - case 209: break; - case 104: + case 207: break; + case 103: { return KtTokens.CONTINUE_KEYWORD ; } // fall through - case 210: break; - case 105: + case 208: break; + case 104: { return KtTokens.TYPE_ALIAS_KEYWORD ; } // fall through - case 211: break; - case 106: + case 209: break; + case 105: { return KtTokens.INTERFACE_KEYWORD ; } // fall through - case 212: break; + case 210: break; default: zzScanError(ZZ_NO_MATCH); } diff --git a/compiler/psi/src/org/jetbrains/kotlin/parsing/KotlinParsing.java b/compiler/psi/src/org/jetbrains/kotlin/parsing/KotlinParsing.java index aa5387fdd24..ff29092398c 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/parsing/KotlinParsing.java +++ b/compiler/psi/src/org/jetbrains/kotlin/parsing/KotlinParsing.java @@ -2428,11 +2428,13 @@ public class KotlinParsing extends AbstractKotlinParsing { projection.done(TYPE_PROJECTION); if (!at(COMMA)) break; advance(); // COMMA - if (at(GT)) { + if (at(GT) || at(GTEQ)) { break; } } + myBuilder.disableJoiningComplexTokens(); + boolean atGT = at(GT); if (!atGT) { error("Expecting a '>'"); @@ -2440,6 +2442,9 @@ public class KotlinParsing extends AbstractKotlinParsing { else { advance(); // GT } + + myBuilder.restoreJoiningComplexTokensState(); + myBuilder.restoreNewlinesState(); return atGT; } diff --git a/compiler/psi/src/org/jetbrains/kotlin/parsing/SemanticWhitespaceAwarePsiBuilderImpl.java b/compiler/psi/src/org/jetbrains/kotlin/parsing/SemanticWhitespaceAwarePsiBuilderImpl.java index 3066c3a262c..7ef5b63a41b 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/parsing/SemanticWhitespaceAwarePsiBuilderImpl.java +++ b/compiler/psi/src/org/jetbrains/kotlin/parsing/SemanticWhitespaceAwarePsiBuilderImpl.java @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.lexer.KtTokens; import static org.jetbrains.kotlin.lexer.KtTokens.*; public class SemanticWhitespaceAwarePsiBuilderImpl extends PsiBuilderAdapter implements SemanticWhitespaceAwarePsiBuilder { - private final TokenSet complexTokens = TokenSet.create(SAFE_ACCESS, ELVIS, EXCLEXCL); + private final TokenSet complexTokens = TokenSet.create(SAFE_ACCESS, ELVIS, EXCLEXCL, GTEQ); private final Stack joinComplexTokens = new Stack<>(); private final Stack newlinesEnabled = new Stack<>(); @@ -155,6 +155,10 @@ public class SemanticWhitespaceAwarePsiBuilderImpl extends PsiBuilderAdapter imp IElementType nextRawToken = rawLookup(rawLookupSteps); if (nextRawToken == EXCL) return EXCLEXCL; } + else if (rawTokenType == GT){ + IElementType nextRawToken = rawLookup(rawLookupSteps); + if (nextRawToken == EQ) return GTEQ; + } return rawTokenType; } @@ -181,9 +185,11 @@ public class SemanticWhitespaceAwarePsiBuilderImpl extends PsiBuilderAdapter imp if (!joinComplexTokens()) return super.getTokenText(); IElementType tokenType = getTokenType(); if (complexTokens.contains(tokenType)) { - if (tokenType == ELVIS) return "?:"; - if (tokenType == SAFE_ACCESS) return "?."; - } + if (tokenType == ELVIS) return "?:"; + if (tokenType == SAFE_ACCESS) return "?."; + if (tokenType == EXCLEXCL) return "!!"; + if (tokenType == GTEQ) return ">="; + } return super.getTokenText(); } diff --git a/compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.kt b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.kt new file mode 100644 index 00000000000..0a19da54f2a --- /dev/null +++ b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.kt @@ -0,0 +1,14 @@ +// FIR_IDENTICAL +// !LANGUAGE: +AllowExpressionAfterTypeReferenceWithoutSpacing +// ISSUE: KT-35811 + +class A + +val reportedProperty: A=A() +fun reportedFunction(a: A=A()): A=a + +val unreportedProperty0: A =A() +fun unreportedFunction0(a: A =A()): A =A() + +val unreportedProperty1: String="" +fun unreportedFunction1(a: Int=0): Int=a \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.txt b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.txt new file mode 100644 index 00000000000..2e611583794 --- /dev/null +++ b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.txt @@ -0,0 +1,15 @@ +package + +public val reportedProperty: A +public val unreportedProperty0: A +public val unreportedProperty1: kotlin.String = "" +public fun reportedFunction(/*0*/ a: A = ...): A +public fun unreportedFunction0(/*0*/ a: A = ...): A +public fun unreportedFunction1(/*0*/ a: kotlin.Int = ...): kotlin.Int + +public final class A { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.fir.kt b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.fir.kt new file mode 100644 index 00000000000..724ea40610e --- /dev/null +++ b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.fir.kt @@ -0,0 +1,13 @@ +// !LANGUAGE: -AllowExpressionAfterTypeReferenceWithoutSpacing +// ISSUE: KT-35811 + +class A + +val reportedProperty: A=A() +fun reportedFunction(a: A=A()): A=a + +val unreportedProperty0: A =A() +fun unreportedFunction0(a: A =A()): A =A() + +val unreportedProperty1: String="" +fun unreportedFunction1(a: Int=0): Int=a diff --git a/compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.kt b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.kt new file mode 100644 index 00000000000..3ca6cbf4303 --- /dev/null +++ b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.kt @@ -0,0 +1,13 @@ +// !LANGUAGE: -AllowExpressionAfterTypeReferenceWithoutSpacing +// ISSUE: KT-35811 + +class A + +val reportedProperty: A=A() +fun reportedFunction(a: A=A()): A=a + +val unreportedProperty0: A =A() +fun unreportedFunction0(a: A =A()): A =A() + +val unreportedProperty1: String="" +fun unreportedFunction1(a: Int=0): Int=a diff --git a/compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.txt b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.txt new file mode 100644 index 00000000000..2e611583794 --- /dev/null +++ b/compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.txt @@ -0,0 +1,15 @@ +package + +public val reportedProperty: A +public val unreportedProperty0: A +public val unreportedProperty1: kotlin.String = "" +public fun reportedFunction(/*0*/ a: A = ...): A +public fun unreportedFunction0(/*0*/ a: A = ...): A +public fun unreportedFunction1(/*0*/ a: kotlin.Int = ...): kotlin.Int + +public final class A { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/psi/recovery/TypeParameterBeforeEqualSign.kt b/compiler/testData/psi/recovery/TypeParameterBeforeEqualSign.kt new file mode 100644 index 00000000000..8bc1a092868 --- /dev/null +++ b/compiler/testData/psi/recovery/TypeParameterBeforeEqualSign.kt @@ -0,0 +1,3 @@ +val a: A= 1 +fun a(): A= 1 +fun a(a: A= 1) {} \ No newline at end of file diff --git a/compiler/testData/psi/recovery/TypeParameterBeforeEqualSign.txt b/compiler/testData/psi/recovery/TypeParameterBeforeEqualSign.txt new file mode 100644 index 00000000000..4b3f17b945e --- /dev/null +++ b/compiler/testData/psi/recovery/TypeParameterBeforeEqualSign.txt @@ -0,0 +1,85 @@ +KtFile: TypeParameterBeforeEqualSign.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + 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(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace('\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + 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(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace('\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + 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(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 2979a530b8a..91a8f488257 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -10661,6 +10661,28 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/expressionAfterTypeReference") + @TestDataPath("$PROJECT_ROOT") + public class ExpressionAfterTypeReference { + @Test + public void testAllFilesPresentInExpressionAfterTypeReference() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/expressionAfterTypeReference"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("allowExpressionAfterTypeReference.kt") + public void testAllowExpressionAfterTypeReference() throws Exception { + runTest("compiler/testData/diagnostics/tests/expressionAfterTypeReference/allowExpressionAfterTypeReference.kt"); + } + + @Test + @TestMetadata("forbidExpressionAfterTypeReference.kt") + public void testForbidExpressionAfterTypeReference() throws Exception { + runTest("compiler/testData/diagnostics/tests/expressionAfterTypeReference/forbidExpressionAfterTypeReference.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/extensions") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java index 713dc71a03e..38c4bdbe2d5 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/parsing/ParsingTestGenerated.java @@ -2396,6 +2396,11 @@ public class ParsingTestGenerated extends AbstractParsingTest { runTest("compiler/testData/psi/recovery/SameLineStatementRecovery.kt"); } + @TestMetadata("TypeParameterBeforeEqualSign.kt") + public void testTypeParameterBeforeEqualSign() throws Exception { + runTest("compiler/testData/psi/recovery/TypeParameterBeforeEqualSign.kt"); + } + @TestMetadata("UnfinishedExtension.kt") public void testUnfinishedExtension() throws Exception { runTest("compiler/testData/psi/recovery/UnfinishedExtension.kt"); diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 543dcbc34ca..a776142cd79 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -262,6 +262,7 @@ enum class LanguageFeature( SynchronizedSuspendError(KOTLIN_1_8), EnableDfaWarningsInK2(KOTLIN_1_8, kind = OTHER), // KT-50965 ReportNonVarargSpreadOnGenericCalls(KOTLIN_1_8, kind = BUG_FIX), // KT-48162 + AllowExpressionAfterTypeReferenceWithoutSpacing(KOTLIN_1_8, kind = BUG_FIX), // KT-35811 // 1.9