<commit_before>use memory::Memory;
use std::io;

#[allow(dead_assignment)]
pub fn interpret(str: String, mem: &mut Memory) {
	let test_arr = str.into_bytes();
	let mut test_ptr = 0u;

	while test_ptr < test_arr.len() {
		let mut ainc = true;
		match test_arr[test_ptr] as char {
			'>' => mem.fwd(),
			'+' => mem.inc(),
			'-' => mem.dcr(),
			'<' => mem.bck(),
			'!' => print!("{}", mem.get() as u8 as char),
			'*' => mem.lft(10),
			'/' => mem.dwn(10),
			')' => mem.adv(10),
			'(' => mem.rwd(10),
			'[' => {
				if mem.get() == 0 {
					while test_ptr < test_arr.len() && test_arr[test_ptr] as char != ']' { 
						test_ptr += 1; 
					}
					ainc = false;
				}
			},
			']' => {
				if mem.get() != 0 {
					while test_ptr > 0 && test_arr[test_ptr] as char != '[' { 
						test_ptr -= 1;
					}
					ainc = false;
				}
			},
			'?' => print!("{}", mem.getptr()),
			'&' => print!("{}", mem.getptr() as u8 as char),
			'.' => print!("{}", mem.get()),
			'`' => {
				let inchr = match io::stdin().read_byte() {
					Ok(val) => val,
					Err(err) => {<commit_msg>Fix: Ported BF cat now works ]<commit_after>use memory::Memory;
use std::io;

#[allow(dead_assignment)]
pub fn interpret(str: String, mem: &mut Memory) {
	let test_arr = str.into_bytes();
	let mut test_ptr = 0u;
	let mut reader = io::stdin();

	while test_ptr < test_arr.len() {
		let mut ainc = true;
		match test_arr[test_ptr] as char {
			'>' => mem.fwd(),
			'+' => mem.inc(),
			'-' => mem.dcr(),
			'<' => mem.bck(),
			'!' => print!("{}", mem.get() as u8 as char),
			'*' => mem.lft(10),
			'/' => mem.dwn(10),
			')' => mem.adv(10),
			'(' => mem.rwd(10),
			'[' => {
				if mem.get() == 0 {
					while test_ptr < test_arr.len() && test_arr[test_ptr] as char != ']' { 
						test_ptr += 1; 
					}
					ainc = false;
				}
			},
			']' => {
				if mem.get() != 0 {
					while test_ptr > 0 && test_arr[test_ptr] as char != '[' { 
						test_ptr -= 1;
					}
					ainc = false;
				}
			},
			'?' => print!("{}", mem.getptr()),
			'&' => print!("{}", mem.getptr() as u8 as char),
			'.' => print!("{}", mem.get()),
			'`' => {
				let inchr = match reader.read_byte() {
					Ok(val) => val,
					Err(err) => {
{'fraction_non_alphanumeric': 0.24874256973022404, 'fraction_numerical': 0.014631915866483767, 'mean_word_length': 2.434850863422292, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 41, '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': '4071604', 'n_tokens_mistral': 1098, 'n_tokens_neox': 898, 'n_words': 184}