<commit_before>namespace BooJs.Compiler

import Boo.Lang.Compiler.Services.UniqueNameProvider as BooUniqueNameProvider


class UniqueNameProvider(BooUniqueNameProvider):
""" Generates unique names for the compilation unit
	TODO: Boo's class does not define the GetUniqueName method as virtual,
	      so it's not possible to inject our behaviour in the dependencies
	      environment.
"""
	_counters = {}

	new def GetUniqueName(*parts as (string)):
		prefix = join(parts, '_')
		if prefix not in _counters:
			_counters[prefix] = 0

		_counters[prefix] = (_counters[prefix] cast int) + 1
		return '_' + prefix + _counters[prefix] + '_'

	virtual def Reset():
		_counters = {}<commit_msg>We can finally use a custom name provider<commit_after>namespace BooJs.Compiler

import Boo.Lang.Compiler.Services.UniqueNameProvider as BooUniqueNameProvider


class UniqueNameProvider(BooUniqueNameProvider):
""" Generates unique names for the compilation unit
	TODO: Boo's class does not define the GetUniqueName method as virtual,
	      so it's not possible to inject our behaviour in the dependencies
	      environment.
"""
	_counters = {}

	override def GetUniqueName(*parts as (string)):
		prefix = join(parts, '_')
		if prefix not in _counters:
			_counters[prefix] = 0

		_counters[prefix] = (_counters[prefix] cast int) + 1
		return '_' + prefix + _counters[prefix] + '_'

	virtual def Reset():
		_counters = {}
{'fraction_non_alphanumeric': 0.09071580439404678, 'fraction_numerical': 0.002834868887313962, 'mean_word_length': 4.559055118110236, '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': '7546006', 'n_tokens_mistral': 440, 'n_tokens_neox': 403, 'n_words': 137}