<commit_before>﻿namespace nbrainfuck
{
    using System;
    using System.IO;
    using System.Linq;
    using BrainfuckInterpreter;

    public static class Program
    {
        /// <summary>
        /// Input function.
        /// </summary>
        private static InputManager inputManager = null;

        /// <summary>
        /// Output action.
        /// </summary>
        private static Action<int> output = null;
        
        /// <summary>
        /// Input function.
        /// </summary>
        private static Func<int> input = null;

        /// <summary>
        /// Memory limit.
        /// </summary>
        private static int memoryLimit = 30000;

        /// <summary>
        /// Source code.
        /// </summary>
        private static string codebase = null;

        /// <summary>
        /// Entry point of the application.
        /// </summary>
        /// <param name="args">Command line arguments.</param>
        public static void Main(string[] args)
        {
            // Set start parameters
            SetStartParameters(args);

            // Initialize output / input
            InitializeOutputAction();
            InitializeInputFunction();

            // Check for compile errors
            JITExecutionResult r = BFInterpretationEngine.CheckCode(codebase, memoryLimit);
            if (r != JITExecutionResult.Succesful)
            {
                Error("Compile error: " + r.ToString(), 3);
            }

            // Initialize interpreter
            BFInterpreter bfi = new BFInterpreter(memoryLimit, input, output);

            // Run
            bfi.Execute(codebase);
        }

        /// <summary>
        /// Initializes the output action.
        /// </summary>
        private static void InitializeOutputAction()
        {
            output = new Action<int>((int i) =>
                {
                    Console.Write((char)i);
                });
        }

        /// <summary>
        /// Initializes input function.
        /// </summary>
        private static void InitializeInputFunction()
        {
            if (inputManager == null)
            {
                input = new Func<int>(() =>
                    {
                        Console.Write("\nInput a character: ");
                        return (int)Console.ReadKey(false).KeyChar;
                    });
            }<commit_msg>Fix related to issue #1<commit_after>﻿namespace nbrainfuck
{
    using System;
    using System.IO;
    using System.Linq;
    using BrainfuckInterpreter;

    public static class Program
    {
        /// <summary>
        /// Input function.
        /// </summary>
        private static InputManager inputManager = null;

        /// <summary>
        /// Output action.
        /// </summary>
        private static Action<int> output = null;
        
        /// <summary>
        /// Input function.
        /// </summary>
        private static Func<int> input = null;

        /// <summary>
        /// Memory limit.
        /// </summary>
        private static int memoryLimit = 30000;

        /// <summary>
        /// Source code.
        /// </summary>
        private static string codebase = null;

        /// <summary>
        /// Entry point of the application.
        /// </summary>
        /// <param name="args">Command line arguments.</param>
        public static void Main(string[] args)
        {
            // Set start parameters
            SetStartParameters(args);

            // Initialize output / input
            InitializeOutputAction();
            InitializeInputFunction();

            // Initialize interpreter
            BFInterpreter bfi = new BFInterpreter(memoryLimit, input, output, codebase);

            // Run
            bfi.Execute(codebase);
        }

        /// <summary>
        /// Initializes the output action.
        /// </summary>
        private static void InitializeOutputAction()
        {
            output = new Action<int>((int i) =>
                {
                    Console.Write((char)i);
                });
        }

        /// <summary>
        /// Initializes input function.
        /// </summary>
        private static void InitializeInputFunction()
        {
            if (inputManager == null)
            {
                input = new Func<int>(() =>
                    {
                        Console.Write("\nInput a character: ");
                        return (int)Console.ReadKey(false).KeyChar;
                    });
            }
{'fraction_non_alphanumeric': 0.11655629139072848, 'fraction_numerical': 0.0026490066225165563, 'mean_word_length': 1.249751737835154, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 51, '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': '2059158', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1058, 'n_words': 278}