<commit_before>require "language/node"

class TreeSitter < Formula
  desc "Parser generator tool and incremental parsing library"
  homepage "https://tree-sitter.github.io/"
  url "https://github.com/tree-sitter/tree-sitter/archive/v0.19.4.tar.gz"
  sha256 "b90c1107a3e09b2dbef9ba317db9fde18f7222898d8470782f539cee286eebad"
  license "MIT"
  head "https://github.com/tree-sitter/tree-sitter.git"

  bottle do
    sha256 cellar: :any, arm64_big_sur: "5a1a7bf5733fc672995798e0f10a65949b4e87b2630619fb7b1df6c0178f1fb1"
    sha256 cellar: :any, big_sur:       "f32fec8c786b23a34b039af879962807cb2537c3c0383a03c77a3b70ffb6ee22"
    sha256 cellar: :any, catalina:      "c1fb5dbc938b5aacd0fcddd07a675b1da6e4204597c387c3a8a043a3c8d435f1"
    sha256 cellar: :any, mojave:        "7c0cea83530cf82d68707fe833844d1f57b09136170d05246992b437a06ed0e1"
  end

  depends_on "emscripten" => [:build, :test]
  depends_on "node" => [:build, :test]
  depends_on "rust" => :build

  def install
    system "make"
    system "make", "install", "PREFIX=#{prefix}"

    # NOTE: This step needs to be done *before* `cargo install`
    cd "lib/binding_web" do
      system "npm", "install", *Language::Node.local_npm_install_args
    end
    system "script/build-wasm"

    cd "cli" do<commit_msg>tree-sitter: update 0.19.4 bottle.<commit_after>require "language/node"

class TreeSitter < Formula
  desc "Parser generator tool and incremental parsing library"
  homepage "https://tree-sitter.github.io/"
  url "https://github.com/tree-sitter/tree-sitter/archive/v0.19.4.tar.gz"
  sha256 "b90c1107a3e09b2dbef9ba317db9fde18f7222898d8470782f539cee286eebad"
  license "MIT"
  head "https://github.com/tree-sitter/tree-sitter.git"

  bottle do
    sha256 cellar: :any, arm64_big_sur: "d0410feee1f5d991543eb20e61e60d0009a673824458f969f45af72792d31989"
    sha256 cellar: :any, big_sur:       "0aa074b679fa9c2c13658b9ba5001fdb0826299267dfce4252e82e325ee12841"
    sha256 cellar: :any, catalina:      "69de9d7d8b6fcfa238886dab08f18d96609d01e826fb2be05dc6ed90584f4863"
    sha256 cellar: :any, mojave:        "0cd1010871589dd72a65e74f605352915a71f08849eda00a0ce77a2565cc07cb"
  end

  depends_on "emscripten" => [:build, :test]
  depends_on "node" => [:build, :test]
  depends_on "rust" => :build

  def install
    system "make"
    system "make", "install", "PREFIX=#{prefix}"

    # NOTE: This step needs to be done *before* `cargo install`
    cd "lib/binding_web" do
      system "npm", "install", *Language::Node.local_npm_install_args
    end
    system "script/build-wasm"

    cd "cli" do
{'fraction_non_alphanumeric': 0.1073799297149551, 'fraction_numerical': 0.17844591956267083, 'mean_word_length': 4.668141592920354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 6, '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': '2320652', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1059, 'n_words': 178}