code: private void _uri() throws
        IOException,
        CssException
    {
      /*
         * Need to run this before IDENT and FUNCTION since the first three
         * chars match IDENT and the entire trigger token matches FUNCTION.
         */
  
      builder.append("url(");
      reader.forward(3);
      if (debug)
      {
        checkArgument('(' == reader.curChar || -1 == reader.peek());
      }
      reader.forward(NOT_WHITESPACE);
      int uristart = reader.next();
  
      if (-1 == uristart)
      {
        builder.error(SCANNER_PREMATURE_EOF, reader);
      }
      else if (QUOTES.matches((char) uristart))
      {
        builder.append('\'');
        _string();
        builder.append('\'');
  
        if (debug && builder.errors.size() < 1)
        {
          checkArgument(QUOTES.matches((char) reader.curChar));
        }
        reader.forward(NOT_WHITESPACE);
        if (reader.peek() > -1)
        {
          reader.next(); // ')'
        }
      }
      else
      {
        // unquoted uri
        builder.append(uristart);
        if (debug)
        {
          checkArgument(NOT_WHITESPACE.matches((char) reader.curChar));
        }
        StringBuilder buf = new StringBuilder();
        while (true)
        {
          CssReader.Mark mark = reader.mark();
          int ch = reader.next();
          if (ch == -1)
          {
            builder.error(SCANNER_PREMATURE_EOF, reader);
            reader.unread(ch, mark);
            break;
          }
          else if (ch == ')')
          {
            break;
          }
          buf.append((char) ch);
        }
        builder.append(WHITESPACE.trimTrailingFrom(buf.toString()));
      }
      builder.append(')');
      builder.type = Type.URI;
  
      if (')' != reader.curChar && builder.errors.size() == 0)
      {
        builder.error(CssErrorCode.SCANNER_ILLEGAL_SYNTAX, reader, reader.curChar);
      }
    }
docs: URI url\({w}{string}{w}\) |
  url\({w}([!#$%&*-\[\]-~]|{nonascii}|{escape})*{w}\)