From 0d29e477ce559481466f7717f51e85e33d1f4d59 Mon Sep 17 00:00:00 2001 From: Nilstrieb Date: Sat, 24 Apr 2021 15:28:00 +0200 Subject: [PATCH] allow warnings --- bfi-rust/src/interpreter/o0.rs | 1 + bfi-rust/src/interpreter/o1.rs | 5 +++-- bfi-rust/src/interpreter/o2.rs | 6 +----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bfi-rust/src/interpreter/o0.rs b/bfi-rust/src/interpreter/o0.rs index d7645c7..da21f82 100644 --- a/bfi-rust/src/interpreter/o0.rs +++ b/bfi-rust/src/interpreter/o0.rs @@ -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}; diff --git a/bfi-rust/src/interpreter/o1.rs b/bfi-rust/src/interpreter/o1.rs index 9606fa1..6369eb4 100644 --- a/bfi-rust/src/interpreter/o1.rs +++ b/bfi-rust/src/interpreter/o1.rs @@ -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); diff --git a/bfi-rust/src/interpreter/o2.rs b/bfi-rust/src/interpreter/o2.rs index 93e3df5..0ac2ed5 100644 --- a/bfi-rust/src/interpreter/o2.rs +++ b/bfi-rust/src/interpreter/o2.rs @@ -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,