<commit_before>module.exports = function (fork) {
  fork.use(require("./core"));
  var types = fork.use(require("../lib/types"));
  var def = types.Type.def;
  var or = types.Type.or;
  var defaults = fork.use(require("../lib/shared")).defaults;

  def("Function")
    .field("generator", Boolean, defaults["false"])
    .field("expression", Boolean, defaults["false"])
    .field("defaults", [or(def("Expression"), null)], defaults.emptyArray)
    // TODO This could be represented as a RestElement in .params.
    .field("rest", or(def("Identifier"), null), defaults["null"]);

  // The ESTree way of representing a ...rest parameter.
  def("RestElement")
    .bases("Pattern")
    .build("argument")
    .field("argument", def("Pattern"));

  def("SpreadElementPattern")
    .bases("Pattern")
    .build("argument")
    .field("argument", def("Pattern"));

  def("FunctionDeclaration")
    .build("id", "params", "body", "generator", "expression");

  def("FunctionExpression")
    .build("id", "params", "body", "generator", "expression");

  // The Parser API calls this ArrowExpression, but Esprima and all other
  // actual parsers use ArrowFunctionExpression.
  def("ArrowFunctionExpression")
    .bases("Function", "Expression")
    .build("params", "body", "expression")
    // The forced null value here is compatible with the overridden
    // definition of the "id" field in the Function interface.
    .field("id", null, defaults["null"])
    // Arrow function bodies are allowed to be expressions.
    .field("body", or(def("BlockStatement"), def("Expression")))
    // The current spec forbids arrow generators, so I have taken the
    // liberty of enforcing that. TODO Report this.
    .field("generator", false, defaults["false"]);

  def("ForOfStatement")
    .build("left", "right", "body")
    .field("left", or(
      def("VariableDeclaration"),
      def("Pattern")))
    .field("right", def("Expression"))
    .field("body", def("Statement"));

  def("YieldExpression")
    .bases("Expression")
    .build("argument", "delegate")
    .field("argument", or(def("Expression"), null))
    .field("delegate", Boolean, defaults["false"]);

  def("GeneratorExpression")
    .bases("Expression")
    .build("body", "blocks", "filter")
    .field("body", def("Expression"))<commit_msg>Make ForOfStatement a subtype of Statement again.<commit_after>module.exports = function (fork) {
  fork.use(require("./core"));
  var types = fork.use(require("../lib/types"));
  var def = types.Type.def;
  var or = types.Type.or;
  var defaults = fork.use(require("../lib/shared")).defaults;

  def("Function")
    .field("generator", Boolean, defaults["false"])
    .field("expression", Boolean, defaults["false"])
    .field("defaults", [or(def("Expression"), null)], defaults.emptyArray)
    // TODO This could be represented as a RestElement in .params.
    .field("rest", or(def("Identifier"), null), defaults["null"]);

  // The ESTree way of representing a ...rest parameter.
  def("RestElement")
    .bases("Pattern")
    .build("argument")
    .field("argument", def("Pattern"));

  def("SpreadElementPattern")
    .bases("Pattern")
    .build("argument")
    .field("argument", def("Pattern"));

  def("FunctionDeclaration")
    .build("id", "params", "body", "generator", "expression");

  def("FunctionExpression")
    .build("id", "params", "body", "generator", "expression");

  // The Parser API calls this ArrowExpression, but Esprima and all other
  // actual parsers use ArrowFunctionExpression.
  def("ArrowFunctionExpression")
    .bases("Function", "Expression")
    .build("params", "body", "expression")
    // The forced null value here is compatible with the overridden
    // definition of the "id" field in the Function interface.
    .field("id", null, defaults["null"])
    // Arrow function bodies are allowed to be expressions.
    .field("body", or(def("BlockStatement"), def("Expression")))
    // The current spec forbids arrow generators, so I have taken the
    // liberty of enforcing that. TODO Report this.
    .field("generator", false, defaults["false"]);

  def("ForOfStatement")
    .bases("Statement")
    .build("left", "right", "body")
    .field("left", or(
      def("VariableDeclaration"),
      def("Pattern")))
    .field("right", def("Expression"))
    .field("body", def("Statement"));

  def("YieldExpression")
    .bases("Expression")
    .build("argument", "delegate")
    .field("argument", or(def("Expression"), null))
    .field("delegate", Boolean, defaults["false"]);

  def("GeneratorExpression")
    .bases("Expression")
    .build("body", "blocks", "filter")
    .field("body", def("Expression"))
{'fraction_non_alphanumeric': 0.18567753001715265, 'fraction_numerical': 0.0, 'mean_word_length': 4.026939655172414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1238362', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1308, 'n_words': 356}