code: protected PseudoSelector pseudo(String ident, PseudoType type, boolean doubleColon) throws ParserException {
  
      	int initialPos = pos;
          StringBuilder sb = new StringBuilder();
          sb.append(ident);
          PseudoExpression expression = null;
          if (!end() && current == '(') {
              sb.append(current);
              next();
              ignoreWhitespaces();
              if (end()) {
                  throw new ParserException("Expected expression at position " + pos);
              }
  
              //expression
              expression = expression();
              sb.append(expression.getContext());
  
              //close parenthesis
              ignoreWhitespaces();
              if (end() || current != ')') {
                  throw new ParserException("Expected ')' at position " + pos);
              }
              sb.append(current);
              next();
          }
          return new PseudoSelector(ident, type, doubleColon, expression, new Context(content, sb.toString(), initialPos, pos));
  
      }
docs: pseudo
  // '::' starts a pseudo-element, ':' a pseudo-class
  // Exceptions: :first-line, :first-letter, :before and :after.
  // Note that pseudo-elements are restricted to one per selector and
  // occur only in the last simple_selector_sequence.
  : ':' ':'? [ IDENT | functional_pseudo ]
  ;
  
  functional_pseudo
  : FUNCTION S* expression ')'