<commit_before>#include "JSONExpr.h"

#include "llvm/Support/Format.h"

using namespace llvm;
namespace clang {
namespace clangd {
namespace json {

void Expr::copyFrom(const Expr &M) {
  Type = M.Type;
  switch (Type) {
  case T_Null:
  case T_Boolean:
  case T_Number:
    memcpy(Union.buffer, M.Union.buffer, sizeof(Union.buffer));
    break;
  case T_StringRef:
    create<StringRef>(M.as<StringRef>());
    break;
  case T_String:
    create<std::string>(M.as<std::string>());
    break;
  case T_Object:
    create<ObjectExpr>(M.as<ObjectExpr>());
    break;
  case T_Array:
    create<ArrayExpr>(M.as<ArrayExpr>());
    break;
  }
}<commit_msg>[clangd] Include the right header for std::isxdigit<commit_after>//=== JSONExpr.cpp - JSON expressions, parsing and serialization - C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===---------------------------------------------------------------------===//

#include "JSONExpr.h"

#include "llvm/Support/Format.h"
#include <cctype>

using namespace llvm;
namespace clang {
namespace clangd {
namespace json {

void Expr::copyFrom(const Expr &M) {
  Type = M.Type;
  switch (Type) {
  case T_Null:
  case T_Boolean:
  case T_Number:
    memcpy(Union.buffer, M.Union.buffer, sizeof(Union.buffer));
    break;
  case T_StringRef:
    create<StringRef>(M.as<StringRef>());
    break;
  case T_String:
    create<std::string>(M.as<std::string>());
    break;
  case T_Object:
    create<ObjectExpr>(M.as<ObjectExpr>());
    break;
  case T_Array:
    create<ArrayExpr>(M.as<ArrayExpr>());
    break;
  }
}
{'fraction_non_alphanumeric': 0.18610129564193167, 'fraction_numerical': 0.0, 'mean_word_length': 2.9976470588235293, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6771539', 'n_tokens_mistral': 572, 'n_tokens_neox': 565, 'n_words': 130}