<commit_before>#!/bin/sh

BISON="$1"
OUTPUT="$2"
INPUT="$3"

if test "x$BISON" = x -o "x$OUTPUT" = x -o "x$INPUT" = x;  then
  echo "usage: $0 <bison> <output> <input>"
  exit 1
fi

#############################################################################
## bison
#############################################################################

${BISON} -d -ra --warnings="deprecated,other,error=conflicts-sr,error=conflicts-rr" -o ${OUTPUT} ${INPUT}
<commit_msg>Make bison script backwards compatible with 2.x<commit_after>#!/bin/sh

BISON="$1"
OUTPUT="$2"
INPUT="$3"

if test "x$BISON" = x -o "x$OUTPUT" = x -o "x$INPUT" = x;  then
  echo "usage: $0 <bison> <output> <input>"
  exit 1
fi

BISON_MAJOR_VER=`${BISON} --version |grep bison|sed -e "s;.* ;;" -e "s;\..*;;"`

if test "${BISON_MAJOR_VER}" -ge "3"; then 
    BISON_OPTS="--warnings=deprecated,other,error=conflicts-sr,error=conflicts-rr"

fi

#############################################################################
## bison
#############################################################################

${BISON} -d -ra ${BISON_OPTS} -o ${OUTPUT} ${INPUT}

{'fraction_non_alphanumeric': 0.43555555555555553, 'fraction_numerical': 0.010666666666666666, 'mean_word_length': 6.1265822784810124, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6491891', 'n_tokens_mistral': 409, 'n_tokens_neox': 376, 'n_words': 86}