<commit_before>#include "./wrapped_re2.h"


#include <string>


using std::string;


NAN_METHOD(WrappedRE2::ToString) {
	NanScope();

	// unpack arguments

	WrappedRE2* re2 = ObjectWrap::Unwrap<WrappedRE2>(args.This());
	if (!re2) {
		NanReturnValue(NanNew(""));
	}

	// actual work

	string buf("/");
	buf += re2->regexp.pattern();
	buf += "/";

	if (re2->ignoreCase) {
		buf += "i";
	}
	if (re2->global) {
		buf += "g";
	}
	if (re2->multiline) {
		buf += "m";
	}

	NanReturnValue(NanNew(buf));
}
<commit_msg>Renamed buf => buffer.<commit_after>#include "./wrapped_re2.h"


#include <string>


using std::string;


NAN_METHOD(WrappedRE2::ToString) {
	NanScope();

	// unpack arguments

	WrappedRE2* re2 = ObjectWrap::Unwrap<WrappedRE2>(args.This());
	if (!re2) {
		NanReturnEmptyString();
	}

	// actual work

	string buffer("/");
	buffer += re2->regexp.pattern();
	buffer += "/";

	if (re2->ignoreCase) {
		buffer += "i";
	}
	if (re2->global) {
		buffer += "g";
	}
	if (re2->multiline) {
		buffer += "m";
	}

	NanReturnValue(NanNew(buffer));
}

{'fraction_non_alphanumeric': 0.20936902485659656, 'fraction_numerical': 0.019120458891013385, 'mean_word_length': 3.824884792626728, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, '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': '2589714', 'n_tokens_mistral': 460, 'n_tokens_neox': 419, 'n_words': 74}