<commit_before>//
// Copyright 2020 WebAssembly Community Group participants
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#include <algorithm>
#include <cassert>
#include <filesystem>
#include <iostream>
#include <utility>

#include "absl/strings/str_format.h"

#include "src/tools/argparser.h"
#include "src/tools/binary_errors.h"
#include "src/tools/text_errors.h"
#include "wasp/base/enumerate.h"
#include "wasp/base/error.h"
#include "wasp/base/features.h"
#include "wasp/base/file.h"
#include "wasp/binary/lazy_expression.h"
#include "wasp/binary/lazy_module.h"
#include "wasp/binary/visitor.h"
#include "wasp/convert/to_binary.h"
#include "wasp/text/desugar.h"
#include "wasp/text/read.h"
#include "wasp/text/read/read_ctx.h"
#include "wasp/text/read/tokenizer.h"
#include "wasp/text/resolve.h"
#include "wasp/valid/valid_ctx.h"
#include "wasp/valid/validate.h"

using absl::Format;
using absl::PrintF;
using absl::StrFormat;

using namespace ::wasp;
namespace fs = std::filesystem;

static int s_verbose = 0;

struct DirectoryInfo {
  std::string directory;        // Name of the directory.
  bool enabled;                 // Whether to run these tests.
  Features::Bits feature_bits;  // Features to enable for these tests.
};

const std::vector<DirectoryInfo> directory_info_map = {
    {"exception-handling", false, Features::Exceptions},
    {"extended-const", false, 0},
    {"function-references", false, Features::FunctionReferences},
    {"gc", false, 0},
    {"memory64", false, Features::Memory64},
    {"multi-memory", false, 0},
    {"mutable-global", true, Features::MutableGlobals},
    {"tail-call", false, Features::TailCall},
    {"threads", true, Features::Threads},
};

class Tool {
 public:
  explicit Tool(string_view filename, SpanU8 data, const Features& features)<commit_msg>Re-enable tail-call testsuite<commit_after>//
// Copyright 2020 WebAssembly Community Group participants
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#include <algorithm>
#include <cassert>
#include <filesystem>
#include <iostream>
#include <utility>

#include "absl/strings/str_format.h"

#include "src/tools/argparser.h"
#include "src/tools/binary_errors.h"
#include "src/tools/text_errors.h"
#include "wasp/base/enumerate.h"
#include "wasp/base/error.h"
#include "wasp/base/features.h"
#include "wasp/base/file.h"
#include "wasp/binary/lazy_expression.h"
#include "wasp/binary/lazy_module.h"
#include "wasp/binary/visitor.h"
#include "wasp/convert/to_binary.h"
#include "wasp/text/desugar.h"
#include "wasp/text/read.h"
#include "wasp/text/read/read_ctx.h"
#include "wasp/text/read/tokenizer.h"
#include "wasp/text/resolve.h"
#include "wasp/valid/valid_ctx.h"
#include "wasp/valid/validate.h"

using absl::Format;
using absl::PrintF;
using absl::StrFormat;

using namespace ::wasp;
namespace fs = std::filesystem;

static int s_verbose = 0;

struct DirectoryInfo {
  std::string directory;        // Name of the directory.
  bool enabled;                 // Whether to run these tests.
  Features::Bits feature_bits;  // Features to enable for these tests.
};

const Features default_features;

const std::vector<DirectoryInfo> directory_info_map = {
    {"exception-handling", false, Features::Exceptions},
    {"extended-const", false, 0},
    {"function-references", false, Features::FunctionReferences},
    {"gc", false, 0},
    {"memory64", false, Features::Memory64},
    {"multi-memory", false, 0},
    {"tail-call", true, default_features.bits() | Features::TailCall},
    {"threads", true, Features::Threads},
};

class Tool {
 public:
  explicit Tool(string_view filename, SpanU8 data, const Features& features)
{'fraction_non_alphanumeric': 0.1369774919614148, 'fraction_numerical': 0.007288317256162915, 'mean_word_length': 4.338672768878719, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3357897', 'n_tokens_mistral': 1488, 'n_tokens_neox': 1462, 'n_words': 428}