/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
final PsiBuilder.Marker anno = builder.mark();
builder.advanceLexer();
- final PsiBuilder.Marker classRef = myParser.getReferenceParser().parseJavaCodeReference(builder, true, false, false, false);
+ PsiBuilder.Marker classRef = null;
+ if (builder.getTokenType() == JavaTokenType.IDENTIFIER) {
+ classRef = myParser.getReferenceParser().parseJavaCodeReference(builder, true, false, false, false);
+ }
if (classRef == null) {
error(builder, JavaErrorMessages.message("expected.class.reference"));
}
--- /dev/null
+PsiJavaFile:AnnoLoop.java
+ PsiJavaToken:LBRACE('{')
+ PsiWhiteSpace(' ')
+ PsiErrorElement:Unexpected token
+ PsiJavaToken:AT('@')
+ PsiJavaToken:AT('@')
+ PsiJavaToken:AT('@')
+ PsiWhiteSpace(' ')
+ PsiField:i
+ PsiModifierList:
+ <empty list>
+ PsiTypeElement:int
+ PsiKeyword:int('int')
+ PsiWhiteSpace(' ')
+ PsiIdentifier:i('i')
+ PsiJavaToken:SEMICOLON(';')
+ PsiWhiteSpace(' ')
+ PsiJavaToken:RBRACE('}')
\ No newline at end of file
public void testAnnoNested() { doParserTest("{ @interface Inner { String bar () default \"<unspecified>\"; } }", true, false); }
public void testAnnoInner() { doParserTest("{ @interface Inner { double bar () default 0.0; } }"); }
public void testAnnoOtherMembers() { doParserTest("{ int field;\n void m() {}\n class C {}\n interface I {} }", true, false); }
+ public void testAnnoLoop() { doParserTest("{ @@@ int i; }"); }
public void testFieldSimple() { doParserTest("{ int field = 0; }"); }
public void testFieldMulti() { doParserTest("{ int field1 = 0, field2; }"); }