<commit_before>package tink.util;

#if neko
	import haxe.io.Bytes;
	import haxe.macro.Context;
	import neko.FileSystem;
	import neko.io.File;

	using tink.macro.tools.MacroTools;
#end
/**
 * ...
 * @author back2dos
 */

class Embed {
	@:macro static public function stringFromFile(file:String) {
		//TODO: consider adding support for line numbers
		var name = String.tempName();
		var caller = Context.getPosInfos(Context.currentPos()).file.split('/');
		caller.pop();
		caller.push(file);
		file = caller.join('/');
		return 
			if (FileSystem.exists(file))
				File.getContent(file).toExpr();
			else<commit_msg>Added helper.<commit_after>package tink.util;

#if neko
	import haxe.io.Bytes;
	import haxe.macro.Context;
	import neko.FileSystem;
	import neko.io.File;

	using tink.macro.tools.MacroTools;
#end
/**
 * ...
 * @author back2dos
 */

class Embed {
	@:macro static public function filePath(file:String) {
		var caller = Context.getPosInfos(Context.currentPos()).file.split('/');
		caller.pop();
		caller.push(file);
		file = caller.join('/');
		return FileSystem.fullPath(file).toExpr();
	}
	@:macro static public function stringFromFile(file:String) {
		//TODO: consider adding support for line numbers
		var name = String.tempName();
		var caller = Context.getPosInfos(Context.currentPos()).file.split('/');
		caller.pop();
		caller.push(file);
		file = caller.join('/');
		return 
			if (FileSystem.exists(file))
				File.getContent(file).toExpr();
			else
{'fraction_non_alphanumeric': 0.15510204081632653, 'fraction_numerical': 0.0013605442176870747, 'mean_word_length': 4.072413793103448, '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': '4855905', 'n_tokens_mistral': 554, 'n_tokens_neox': 505, 'n_words': 106}