<commit_before>﻿namespace AjTalk.Language
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    using AjTalk;
    using AjTalk.Language;

    public class DoesNotUnderstandMethod : IMethod
    {
        public DoesNotUnderstandMethod(Machine machine, IBehavior behavior)
        {
            this.Name = "doesNotUnderstand:with:";
            this.Behavior = behavior;
        }

        public string Name
        {
            get;
            private set;
        }

        public string SourceCode { get { return null; } }

        public byte[] Bytecodes { get { return null; } }
        
        public IBehavior Behavior
        {
            get;
            set;
        }

        public object Execute(Machine machine, IObject self, object[] args)
        {
            return this.DoesNotUnderstand(machine, self, (string)args[0], (object[])args[1]);
        }

        public object Execute(Machine machine, object[] args)
        {
            throw new NotImplementedException();
        }

        public object ExecuteInProcess(Process process, object[] args)
        {
            throw new NotImplementedException();
        }

        public object ExecuteNative(Machine machine, object self, object[] args)
        {
            throw new NotImplementedException();
        }

        protected virtual object DoesNotUnderstand(Machine machine, IObject self, string msgname, object[] args)
        {
            if (msgname.Equals("ifFalse:"))
            {
                IBlock block = (IBlock)args[0];
                block.Execute(machine, null);
                
                // TODO return block value??
                return machine.GetGlobalObject("nil");
            }

            if (msgname.Equals("class"))
            {
                return self.Behavior;
            }

            if (machine.HostMachine != null)
            {
                IBehavior behavior = machine.HostMachine.GetAssociatedBehavior(self.Behavior);

                if (behavior != null) 
                {
                    IMethod method = behavior.GetInstanceMethod(msgname);

                    if (method != null)
                        return method.Execute(machine, self, args);

                    method = behavior.GetInstanceMethod(this.Name);
<commit_msg>Removing unnecesary code from DoesNotUnderstandMethod<commit_after>﻿namespace AjTalk.Language
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    using AjTalk;
    using AjTalk.Language;

    public class DoesNotUnderstandMethod : IMethod
    {
        public DoesNotUnderstandMethod(Machine machine, IBehavior behavior)
        {
            this.Name = "doesNotUnderstand:with:";
            this.Behavior = behavior;
        }

        public string Name
        {
            get;
            private set;
        }

        public string SourceCode { get { return null; } }

        public byte[] Bytecodes { get { return null; } }
        
        public IBehavior Behavior
        {
            get;
            set;
        }

        public object Execute(Machine machine, IObject self, object[] args)
        {
            return this.DoesNotUnderstand(machine, self, (string)args[0], (object[])args[1]);
        }

        public object Execute(Machine machine, object[] args)
        {
            throw new NotImplementedException();
        }

        public object ExecuteInProcess(Process process, object[] args)
        {
            throw new NotImplementedException();
        }

        public object ExecuteNative(Machine machine, object self, object[] args)
        {
            throw new NotImplementedException();
        }

        protected virtual object DoesNotUnderstand(Machine machine, IObject self, string msgname, object[] args)
        {
            if (machine.HostMachine != null)
            {
                IBehavior behavior = machine.HostMachine.GetAssociatedBehavior(self.Behavior);

                if (behavior != null) 
                {
                    IMethod method = behavior.GetInstanceMethod(msgname);

                    if (method != null)
                        return method.Execute(machine, self, args);

                    method = behavior.GetInstanceMethod(this.Name);

{'fraction_non_alphanumeric': 0.08197484862598975, 'fraction_numerical': 0.0011644154634373545, 'mean_word_length': 1.6710199004975124, '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': '3512056', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1002, 'n_words': 265}