<commit_before>require 'formula'

class RagelUserGuide < Formula
  url 'http://www.complang.org/ragel/ragel-guide-6.7.pdf'
  sha1 '6f3483fea075941c989ac37e6c49afabc7e181c0'
end

class Ragel < Formula
  homepage 'http://www.complang.org/ragel/'
  url 'http://www.complang.org/ragel/ragel-6.7.tar.gz'
  md5 'f4423e0d8a6538dd4e61498fcfad3cec'

  def install
    system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
    system "make install"

    # Install the prebuilt PDF documentation
    RagelUserGuide.new.brew { doc.install Dir['*.pdf'] }
  end
end<commit_msg>Fix Ragel formula when building with Clang<commit_after>require 'formula'

class RagelUserGuide < Formula
  url 'http://www.complang.org/ragel/ragel-guide-6.7.pdf'
  sha1 '6f3483fea075941c989ac37e6c49afabc7e181c0'
end

class Ragel < Formula
  homepage 'http://www.complang.org/ragel/'
  url 'http://www.complang.org/ragel/ragel-6.7.tar.gz'
  md5 'f4423e0d8a6538dd4e61498fcfad3cec'

  def install
    if MacOS.default_compiler == :clang
      # fix build with clang
      inreplace ["aapl/avlcommon.h", "aapl/bstcommon.h", "aapl/bubblesort.h", "aapl/mergesort.h"], /([^:.])(compare)/, '\1this->\2'
      # fix build with libc++
      inreplace 'ragel/javacodegen.cpp', /setiosflags/, 'std::\&'
    end

    system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
    system "make install"

    # Install the prebuilt PDF documentation
    RagelUserGuide.new.brew { doc.install Dir['*.pdf'] }
  end
end
{'fraction_non_alphanumeric': 0.14750830564784054, 'fraction_numerical': 0.06378737541528239, 'mean_word_length': 3.7961783439490446, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '7186295', 'n_tokens_mistral': 643, 'n_tokens_neox': 572, 'n_words': 104}