Revert "KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing"
This reverts commit a2077f9063.
This commit is contained in:
@@ -283,6 +283,7 @@ LONELY_BACKTICK=`
|
||||
"++" { return KtTokens.PLUSPLUS ; }
|
||||
"--" { return KtTokens.MINUSMINUS; }
|
||||
"<=" { return KtTokens.LTEQ ; }
|
||||
">=" { return KtTokens.GTEQ ; }
|
||||
"==" { return KtTokens.EQEQ ; }
|
||||
"!=" { return KtTokens.EXCLEQ ; }
|
||||
"&&" { return KtTokens.ANDAND ; }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+4
-10
@@ -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, GTEQ);
|
||||
private final TokenSet complexTokens = TokenSet.create(SAFE_ACCESS, ELVIS, EXCLEXCL);
|
||||
private final Stack<Boolean> joinComplexTokens = new Stack<>();
|
||||
|
||||
private final Stack<Boolean> newlinesEnabled = new Stack<>();
|
||||
@@ -155,10 +155,6 @@ 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;
|
||||
}
|
||||
|
||||
@@ -185,11 +181,9 @@ 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 == EXCLEXCL) return "!!";
|
||||
if (tokenType == GTEQ) return ">=";
|
||||
}
|
||||
if (tokenType == ELVIS) return "?:";
|
||||
if (tokenType == SAFE_ACCESS) return "?.";
|
||||
}
|
||||
return super.getTokenText();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user