<commit_before>use strict;
use warnings;
use File::Slurp;
use JSON::XS;

my $filename = $ARGV[0];
if (!-e $filename) {
	print "Usage: $0 <path/to/config.cpp>\n";
	print "Dumps a JSON file called config.json in the current folder.\n";
	exit;
}

my $data = read_file($filename);
my $out = remove_whitespace($data);
my $class_tree = parse_class($out);<commit_msg>Check if the filename is defined<commit_after>#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
BEGIN { unshift @INC, "$FindBin::Bin/../local/lib/perl5" }
use File::Slurp;
use JSON::XS;

my $filename = $ARGV[0];
if (!defined $filename || !-e $filename) {
	print "Usage: $0 <path/to/config.cpp>\n";
	print "Dumps a JSON file called config.json in the current folder.\n";
	exit;
}

my $data = read_file($filename);
my $out = remove_whitespace($data);
my $class_tree = parse_class($out);
{'fraction_non_alphanumeric': 0.16998827667057445, 'fraction_numerical': 0.005861664712778429, 'mean_word_length': 5.014084507042254, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1178989', 'n_tokens_mistral': 321, 'n_tokens_neox': 314, 'n_words': 92}