private char[] getUnicodeChar() {
    char[] result = empty;
    int mark = cursor - 2;
    int codePoint = 0;
    int i = 4;
    while ( i > 0 && hasNext() ) {
      char c = next(false);
      int value = Character.digit(c, 16);
      if ( value >= 0 ) {
	codePoint = (codePoint << 4) + value;
	--i;
      }
      else {
	expected("hex-digit", c);
	break;
      }
    }
    if ( i == 0 ) {
      result = Character.toChars(codePoint);
    }
    else {
      invalidUnicode(mark);
    }
    return result;
  }