<commit_before>#include "includes.h"

Identifier::Identifier(const string &name) : NativeObject(OBJ_IDENTIFIER), _name(name)
{
}

Identifier::~Identifier()
{
}

NativeObject_p Identifier::equal(const NativeObject_p other) const
{
  if(!IS_IDENT(other))
    return nil;
  
  Identifier_p other_ident = (Identifier_p)other;
  if(this->_name == other_ident->_name)
    return t;
  return nil;
}

FancyObject_p Identifier::eval(Scope *scope)
{
  NativeMethod_p bif = scope->get_native(this->_name);
  if(bif) {
    return MethodClass->create_instance(bif);
  } else {
    return ObjectClass->create_instance(scope->get(this->_name));
  }
}

string Identifier::to_s() const
{
  return this->_name;
}

string Identifier::name() const
{
  return this->_name;
}

map<string, Identifier_p> Identifier::ident_cache;
Identifier_p Identifier::from_string(const string &name)
{
  if(ident_cache.find(name) != ident_cache.end()) {
    return ident_cache[name];<commit_msg>little fix to Identifier#eval<commit_after>#include "includes.h"

Identifier::Identifier(const string &name) : NativeObject(OBJ_IDENTIFIER), _name(name)
{
}

Identifier::~Identifier()
{
}

NativeObject_p Identifier::equal(const NativeObject_p other) const
{
  if(!IS_IDENT(other))
    return nil;
  
  Identifier_p other_ident = (Identifier_p)other;
  if(this->_name == other_ident->_name)
    return t;
  return nil;
}

FancyObject_p Identifier::eval(Scope *scope)
{
  NativeMethod_p bif = scope->get_native(this->_name);
  if(bif) {
    return MethodClass->create_instance(bif);
  } else {
    // return ObjectClass->create_instance(scope->get(this->_name));
    return scope->get(this->_name);
  }
}

string Identifier::to_s() const
{
  return this->_name;
}

string Identifier::name() const
{
  return this->_name;
}

map<string, Identifier_p> Identifier::ident_cache;
Identifier_p Identifier::from_string(const string &name)
{
  if(ident_cache.find(name) != ident_cache.end()) {
    return ident_cache[name];
{'fraction_non_alphanumeric': 0.14104515474378487, 'fraction_numerical': 0.0, 'mean_word_length': 5.465573770491804, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '4778359', 'n_tokens_mistral': 680, 'n_tokens_neox': 674, 'n_words': 120}