<commit_before>package main

import "strings"

func initRString() *RObject {
	obj := &RObject{}
	obj.name = "RString"
	obj.ivars = make(map[string]Object)
	obj.class = nil
	obj.methods = make(map[string]*RMethod)

	// RString method initialization
	obj.methods["new"] = &RMethod{gofunc: RString_new}
	obj.methods["to_s"] = &RMethod{gofunc: RString_to_s}
	obj.methods["inspect"] = &RMethod{gofunc: RString_inspect}
	obj.methods["size"] = &RMethod{gofunc: RString_length}
	obj.methods["len"] = &RMethod{gofunc: RString_length}
	obj.methods["split"] = &RMethod{gofunc: RString_split}

	return obj
}

// String.new(str='')
// v = [string]
func RString_new(vm *GobiesVM, receiver Object, v []Object) Object {
	str := ""
	if len(v) == 1 {
		str = v[0].(string)
	}

	obj := &RObject{}
	obj.class = vm.consts["RString"]
	obj.val.str = str

	return obj
}

func RString_to_s(vm *GobiesVM, receiver Object, v []Object) Object {
	obj := receiver.(*RObject)
	return obj
}

func RString_inspect(vm *GobiesVM, receiver Object, v []Object) Object {
	obj := receiver.(*RObject)
	str := obj.val.str
	return RString_new(vm, nil, []Object{"'" + str + "'"})
}

func RString_length(vm *GobiesVM, receiver Object, v []Object) Object {<commit_msg>[RString] concatenation<commit_after>package main

import "strings"

func initRString() *RObject {
	obj := &RObject{}
	obj.name = "RString"
	obj.ivars = make(map[string]Object)
	obj.class = nil
	obj.methods = make(map[string]*RMethod)

	// RString method initialization
	obj.methods["new"] = &RMethod{gofunc: RString_new}
	obj.methods["+"] = &RMethod{gofunc: RString_concat}
	obj.methods["to_s"] = &RMethod{gofunc: RString_to_s}
	obj.methods["inspect"] = &RMethod{gofunc: RString_inspect}
	obj.methods["size"] = &RMethod{gofunc: RString_length}
	obj.methods["len"] = &RMethod{gofunc: RString_length}
	obj.methods["split"] = &RMethod{gofunc: RString_split}

	return obj
}

// String.new(str='')
// v = [string]
func RString_new(vm *GobiesVM, receiver Object, v []Object) Object {
	str := ""
	if len(v) == 1 {
		str = v[0].(string)
	}

	obj := &RObject{}
	obj.class = vm.consts["RString"]
	obj.val.str = str

	return obj
}

func RString_concat(vm *GobiesVM, receiver Object, v []Object) Object {
	obj := receiver.(*RObject)
	substr := v[0].(*RObject).val.str

	return RString_new(vm, nil, []Object{obj.val.str + substr})
}

func RString_to_s(vm *GobiesVM, receiver Object, v []Object) Object {
	obj := receiver.(*RObject)
	return obj
}

func RString_inspect(vm *GobiesVM, receiver Object, v []Object) Object {
	obj := receiver.(*RObject)
	str := obj.val.str
	return RString_new(vm, nil, []Object{"'" + str + "'"})
}

func RString_length(vm *GobiesVM, receiver Object, v []Object) Object {
{'fraction_non_alphanumeric': 0.17091177556293835, 'fraction_numerical': 0.0018456995201181247, 'mean_word_length': 5.062639821029083, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1250108', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1044, 'n_words': 225}