// [attribute]
if (StringUtilities.startsWithChar(text, '[') && StringUtilities.endsWithChar(text, ']')) {
int nameOffset = offset + 1;
String attributeName = text.substring(1, text.length() - 1);
// TODO(scheglov) report warning if there are spaces between [ and identifier
return new HasAttributeSelectorElementImpl(attributeName, nameOffset);
}
// .class
if (StringUtilities.startsWithChar(text, '.')) {
int nameOffset = offset + 1;
String className = text.substring(1, text.length());