mirror of
https://github.com/Noratrieb/brainfuck.git
synced 2026-01-14 13:35:00 +01:00
allow warnings
This commit is contained in:
parent
3b5fb2b528
commit
0d29e477ce
3 changed files with 5 additions and 7 deletions
|
|
@ -1,5 +1,6 @@
|
|||
//!
|
||||
//! The very basic interpreter without any optimizations
|
||||
#![allow(dead_code)]
|
||||
|
||||
use crate::interpreter::{MEM_SIZE, minify};
|
||||
use std::io::{stdin, Read};
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@
|
|||
//!
|
||||
//! first parse the bf so that it can be executed faster
|
||||
//! most importantly: loop jumps should be immediate
|
||||
//!
|
||||
#![allow(dead_code)]
|
||||
|
||||
use std::io::{Read, stdin};
|
||||
|
||||
use crate::interpreter::{MEM_SIZE, Memory, minify, parse, Statement};
|
||||
|
||||
pub fn run(pgm: &str) -> String {
|
||||
pub fn _run(pgm: &str) -> String {
|
||||
let pgm = minify(pgm);
|
||||
let pgm = parse(pgm.chars().collect());
|
||||
let out = interpret(&pgm);
|
||||
|
|
|
|||
|
|
@ -4,16 +4,12 @@
|
|||
|
||||
use std::io::{Read, stdin};
|
||||
|
||||
use crate::interpreter::{minify, parse, Statement};
|
||||
use crate::interpreter::{minify, parse, Statement, Memory, MEM_SIZE};
|
||||
use std::error::Error;
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::fmt;
|
||||
use std::ops::Deref;
|
||||
|
||||
const MEM_SIZE: usize = 0xFFFF;
|
||||
|
||||
type Memory = [u8; MEM_SIZE];
|
||||
|
||||
#[derive(PartialOrd, PartialEq, Ord, Eq, Clone, Debug)]
|
||||
enum ExStatement {
|
||||
Inc,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue