mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-114427 Using $this in GString marked as invalid (Identifier or code block expected)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -22,8 +22,6 @@ import java.util.*;
|
||||
|
||||
%%
|
||||
|
||||
%{@SuppressWarnings({"UnnecessaryFullyQualifiedName", "FieldCanBeLocal", "UnusedDeclaration", "UnusedAssignment", "AccessStaticViaInstance",
|
||||
"AssignmentToStaticFieldFromInstanceMethod", "MethodMayBeStatic", "CStyleArrayDeclaration", "UnnecessarySemicolon"}) %}
|
||||
%class _GroovyLexer
|
||||
%implements FlexLexer, GroovyTokenTypes, TokenType
|
||||
%unicode
|
||||
|
||||
+2
-2
@@ -143,10 +143,10 @@ public class CompoundStringExpression implements GroovyElementTypes {
|
||||
final PsiBuilder.Marker injection = myBuilder.mark();
|
||||
ParserUtils.getToken(myBuilder, mDOLLAR);
|
||||
|
||||
if (mIDENT.equals(myBuilder.getTokenType())) {
|
||||
if (myBuilder.getTokenType() == mIDENT || myBuilder.getTokenType() == kTHIS) {
|
||||
PathExpression.parse(myBuilder, myParser);
|
||||
}
|
||||
else if (mLCURLY.equals(myBuilder.getTokenType())) {
|
||||
else if (myBuilder.getTokenType() == mLCURLY) {
|
||||
OpenOrClosableBlock.parseClosableBlock(myBuilder, myParser);
|
||||
}
|
||||
else {
|
||||
|
||||
+2
@@ -148,6 +148,8 @@ public class ExpressionsParsingTest extends GroovyParsingTestCase {
|
||||
|
||||
public void testgstring$ugly_lexer() throws Throwable { doTest(); }
|
||||
|
||||
public void testgstring$this() {doTest()}
|
||||
|
||||
public void testmapLiteral() throws Throwable { doTest(); }
|
||||
|
||||
public void testnew$arr_decl() throws Throwable { doTest(); }
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
print "abc $this.prop test"
|
||||
-----
|
||||
Groovy script
|
||||
Call expression
|
||||
Reference expression
|
||||
PsiElement(identifier)('print')
|
||||
PsiWhiteSpace(' ')
|
||||
Command arguments
|
||||
Compound Gstring
|
||||
PsiElement(Gstring begin)('"')
|
||||
GrStringContentImpl(GString content element)
|
||||
PsiElement(Gstring content)('abc ')
|
||||
GString injection
|
||||
PsiElement($)('$')
|
||||
Reference expression
|
||||
PsiElement(this)('this')
|
||||
GrStringContentImpl(GString content element)
|
||||
PsiElement(Gstring content)('.prop test')
|
||||
PsiElement(Gstring end)('"')
|
||||
Reference in New Issue
Block a user