[Parser] Fix parsing of unfinished dot access in string template
Problem appeared in cases like this: "{someVar.}"
#KT-34440 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
8999fd88b1
commit
329066a4f3
+5
@@ -328,6 +328,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt310.kt");
|
runTest("compiler/testData/diagnostics/tests/kt310.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt34440.kt")
|
||||||
|
public void testKt34440() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt34440.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt34857.kt")
|
@TestMetadata("kt34857.kt")
|
||||||
public void testKt34857() throws Exception {
|
public void testKt34857() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/kt34857.kt");
|
runTest("compiler/testData/diagnostics/tests/kt34857.kt");
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ import static org.jetbrains.kotlin.lexer.KtTokens.*;
|
|||||||
IElementType tt = tt();
|
IElementType tt = tt();
|
||||||
if (recoverySet == null ||
|
if (recoverySet == null ||
|
||||||
recoverySet.contains(tt) ||
|
recoverySet.contains(tt) ||
|
||||||
tt == LBRACE || tt == RBRACE ||
|
tt == LBRACE || tt == RBRACE || tt == LONG_TEMPLATE_ENTRY_END ||
|
||||||
(recoverySet.contains(EOL_OR_SEMICOLON) && (eof() || tt == SEMICOLON || myBuilder.newlineBeforeCurrentToken()))) {
|
(recoverySet.contains(EOL_OR_SEMICOLON) && (eof() || tt == SEMICOLON || myBuilder.newlineBeforeCurrentToken()))) {
|
||||||
error(message);
|
error(message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// ISSUE: KT-34440
|
||||||
|
|
||||||
|
class BufferUtil {
|
||||||
|
fun isDirect(cond: Boolean): Boolean =
|
||||||
|
when (cond) {
|
||||||
|
else -> throw Exception("${buf.<!SYNTAX!><!>}")
|
||||||
|
}
|
||||||
|
private class BufferInfo(private val type: Class<*>)
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// ISSUE: KT-34440
|
||||||
|
|
||||||
|
class BufferUtil {
|
||||||
|
fun isDirect(cond: Boolean): Boolean =
|
||||||
|
when (<!UNUSED_EXPRESSION!>cond<!>) {
|
||||||
|
else -> throw Exception("${<!UNRESOLVED_REFERENCE!>buf<!>.<!SYNTAX!><!>}")
|
||||||
|
}
|
||||||
|
private class BufferInfo(private val type: Class<*>)
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public final class BufferUtil {
|
||||||
|
public constructor BufferUtil()
|
||||||
|
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 final fun isDirect(/*0*/ cond: kotlin.Boolean): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|
||||||
|
private final class BufferInfo {
|
||||||
|
public constructor BufferInfo(/*0*/ type: java.lang.Class<*>)
|
||||||
|
private final val type: java.lang.Class<*>
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -330,6 +330,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt310.kt");
|
runTest("compiler/testData/diagnostics/tests/kt310.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt34440.kt")
|
||||||
|
public void testKt34440() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt34440.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt34857.kt")
|
@TestMetadata("kt34857.kt")
|
||||||
public void testKt34857() throws Exception {
|
public void testKt34857() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/kt34857.kt");
|
runTest("compiler/testData/diagnostics/tests/kt34857.kt");
|
||||||
|
|||||||
Generated
+5
@@ -330,6 +330,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt310.kt");
|
runTest("compiler/testData/diagnostics/tests/kt310.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt34440.kt")
|
||||||
|
public void testKt34440() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt34440.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt34857.kt")
|
@TestMetadata("kt34857.kt")
|
||||||
public void testKt34857() throws Exception {
|
public void testKt34857() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/kt34857.kt");
|
runTest("compiler/testData/diagnostics/tests/kt34857.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user