docs: public static SymbolVariant symbolVariant(CharSequence symbol)
      {
          int length = symbol.length(); // acts as null check
  
          // If the symbol's text matches an Ion keyword or it's an empty symbol, we must quote it.
          // Eg, the symbol 'false' and '' must be rendered quoted.
          if(length == 0 || isIdentifierKeyword(symbol))
          {
              return SymbolVariant.QUOTED;
          }
  
          char c = symbol.charAt(0);
          // Surrogates are neither identifierStart nor operatorPart, so the
          // first one we hit will fall through and return QUOTED.
          // TODO test that
  
          if (isIdentifierStart(c))
          {
              for (int ii = 0; ii < length; ii++) {
                  c = symbol.charAt(ii);
                  if ((c == '\'' || c < 32 || c > 126)
                      || !isIdentifierPart(c))
                  {
                      return SymbolVariant.QUOTED;
                  }
              }
              return SymbolVariant.IDENTIFIER;
          }
  
          if (isOperatorPart(c))
          {
              for (int ii = 0; ii < length; ii++) {
                  c = symbol.charAt(ii);
                  // We don't need to look for escapes since all
                  // operator characters are ASCII.
                  if (!isOperatorPart(c)) {
                      return SymbolVariant.QUOTED;
                  }
              }
              return SymbolVariant.OPERATOR;
          }
  
          return SymbolVariant.QUOTED;
      }