List<HiddenTokenAwareTree> children = token.getChildren();
if (children.size() == 0)
throw new BugHappened(GRAMMAR_MISMATCH, token);
if (children.size() == 1)
return new SelectorAttribute(token, children.get(0).getText());
if (children.size() < 3)
throw new BugHappened(GRAMMAR_MISMATCH, token);
Expression value = handleTerm(children.get(2));
switch (value.getType()) {
case IDENTIFIER_EXPRESSION:
case STRING_EXPRESSION:
case NUMBER:
//those are OK
break;
default:
problemsHandler.warnLessjsIncompatibleSelectorAttributeValue(value);
break;
}
return new SelectorAttribute(token, children.get(0).getText(), handleSelectorOperator(children.get(1)), value);
}