code: private void _quantity() throws
        IOException,
        CssException
    {
  
      if (debug)
      {
        int ch = reader.peek();
        checkState(QNTSTART.matches((char) ch) || isNextEscape());
        checkState(builder.getLength() > 0
            && NUM.matches(builder.getLast()));
      }
  
      /*
         * Assume we have a {num}{ident} instance (DIMEN), and then override
         * that if a specific quantity literal is found.
         */
      builder.type = Type.QNTY_DIMEN;
      TokenBuilder suffix = new TokenBuilder(reader, errHandler, locale);
      append(QNTSTART, suffix);
      if (suffix.getLast() != '%')
      { // QNTSTART = NMSTART | '%'
        append(NMCHAR, suffix);
      }
  
      if (suffix.getLength() > QNT_TOKEN_MAXLENGTH)
      {
        // longer than max length in quantities map
        builder.append(suffix.toString());
        return;
      }
  
      // shorter or equal to max length in quantities map
      // we might have a more specific match
      final int[] ident = suffix.toArray();
      int[] match = null;
  
      for (int[] test : quantities.keySet())
      {
        if (equals(ident, test, true))
        {
          builder.type = quantities.get(test);
          match = test;
          break;
        }
      }
  
      if (builder.type == Type.QNTY_DIMEN)
      {
        builder.append(ident);
      }
      else
      {
        if (debug)
        {
          checkState(match != null);
        }
        builder.append(match);
      }
  
    }
docs: With incoming builder containing a valid NUMBER, and next char being a
  valid QNTSTART, modify the type and append to the builder