<commit_before><?php
namespace Desmond;
use Desmond\Desmond;
use Desmond\data_types\VoidType;

class Repl
{
	private $desmond;

	public function __construct()
	{
		$this->desmond = new Desmond();
	}

	public function start()
	{
		$this->welcome();
		do {
			$input = $this->promptForInput();

			if ($this->isExitCommand($input)) {
		        exit("Later, guy.\n");
		    }

		    if ($this->shouldBeProcessed($input)) {
		        try {
		            $return = $this->desmond->pretty(
						$this->desmond->run($input));
		        } catch (Exception $exception) {
		            echo "#! {$exception->getMessage()}\n";
		            continue;
		        }
		        echo $return . "\n";
		    }
		} while (!feof(STDIN));
	}

	private function welcome()
	{
		echo "
Copyright 2017, <NAME>
Version 0.3.0
Welcome to Desmond's REPL.\n\n";
	}

	private function promptForInput()
	{
		echo '/user λ ';
	    return fgets(STDIN);
	}

	private function isExitCommand($input)
	{
		return $input == "exit\n";
	}

	private function shouldBeProcessed($input)
	{
		return !empty($input) && !preg_match('/^;/', $input);
	}
}
<commit_msg>Tabs to spaces in REPL. Bloody heck.<commit_after><?php
namespace Desmond;
use Desmond\Desmond;
use Desmond\data_types\VoidType;

class Repl
{
    private $desmond;

    public function __construct()
    {
        $this->desmond = new Desmond();
    }

    public function start()
    {
        $this->welcome();
        do {
            $input = $this->promptForInput();

            if ($this->isExitCommand($input)) {
                exit("Later, guy.\n");
            }

            if ($this->shouldBeProcessed($input)) {
                try {
                    $return = $this->desmond->pretty(
                        $this->desmond->run($input));
                } catch (Exception $exception) {
                    echo "#! {$exception->getMessage()}\n";
                    continue;
                }
                echo $return . "\n";
            }
        } while (!feof(STDIN));
    }

    private function welcome()
    {
        echo "
Copyright 2017, <NAME>
Version 0.3.0
Welcome to Desmond's REPL.\n\n";
    }

    private function promptForInput()
    {
        echo '/user λ ';
        return fgets(STDIN);
    }

    private function isExitCommand($input)
    {
        return $input == "exit\n";
    }

    private function shouldBeProcessed($input)
    {
        return !empty($input) && !preg_match('/^;/', $input);
    }
}

{'fraction_non_alphanumeric': 0.15216511533791988, 'fraction_numerical': 0.0056657223796034, 'mean_word_length': 1.9463647199046483, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, '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': '5779143', 'n_tokens_mistral': 849, 'n_tokens_neox': 762, 'n_words': 164}