From 14c08bbcdbb0dc469bd318d2d5024a58ffd7a48f Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 19 Mar 2019 18:40:21 -0700 Subject: [PATCH] Get rid of EvalOptions and associated types --- schala-lang/language/src/lib.rs | 2 +- schala-repl/src/language.rs | 17 ----------------- schala-repl/src/lib.rs | 3 +-- schala-repl/src/repl/mod.rs | 2 +- schala-repl/src/webapp.rs | 2 +- 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/schala-lang/language/src/lib.rs b/schala-lang/language/src/lib.rs index 9efbff6..f986e21 100644 --- a/schala-lang/language/src/lib.rs +++ b/schala-lang/language/src/lib.rs @@ -21,7 +21,7 @@ use std::cell::RefCell; use std::rc::Rc; use itertools::Itertools; -use schala_repl::{ProgrammingLanguageInterface, EvalOptions, ComputationRequest, ComputationResponse, GlobalOutputStats}; +use schala_repl::{ProgrammingLanguageInterface, ComputationRequest, ComputationResponse, GlobalOutputStats}; macro_rules! bx { ($e:expr) => { Box::new($e) } diff --git a/schala-repl/src/language.rs b/schala-repl/src/language.rs index 3ce0d6a..bb02c49 100644 --- a/schala-repl/src/language.rs +++ b/schala-repl/src/language.rs @@ -1,22 +1,5 @@ use std::time; -#[derive(Debug, Default, Serialize, Deserialize)] -pub struct EvalOptions { - pub execution_method: ExecutionMethod, -} - -#[derive(Debug, Serialize, Deserialize)] -pub enum ExecutionMethod { - Compile, - Interpret, -} - -impl Default for ExecutionMethod { - fn default() -> ExecutionMethod { - ExecutionMethod::Interpret - } -} - pub trait ProgrammingLanguageInterface { fn get_language_name(&self) -> String; fn get_source_file_suffix(&self) -> String; diff --git a/schala-repl/src/lib.rs b/schala-repl/src/lib.rs index 32dc190..5f65185 100644 --- a/schala-repl/src/lib.rs +++ b/schala-repl/src/lib.rs @@ -24,8 +24,7 @@ mod repl; mod language; mod webapp; -pub use language::{ProgrammingLanguageInterface, EvalOptions, - ExecutionMethod, ComputationRequest, ComputationResponse, GlobalOutputStats}; +pub use language::{ProgrammingLanguageInterface, ComputationRequest, ComputationResponse, GlobalOutputStats}; include!(concat!(env!("OUT_DIR"), "/static.rs")); const VERSION_STRING: &'static str = "0.1.0"; diff --git a/schala-repl/src/repl/mod.rs b/schala-repl/src/repl/mod.rs index 69456b6..38bf025 100644 --- a/schala-repl/src/repl/mod.rs +++ b/schala-repl/src/repl/mod.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use colored::*; use itertools::Itertools; -use crate::language::{ProgrammingLanguageInterface, EvalOptions, ComputationRequest, ComputationResponse}; +use crate::language::{ProgrammingLanguageInterface, ComputationRequest, ComputationResponse}; mod command_tree; use self::command_tree::{CommandTree, BoxedCommandFunction}; diff --git a/schala-repl/src/webapp.rs b/schala-repl/src/webapp.rs index d0c046f..a25e547 100644 --- a/schala-repl/src/webapp.rs +++ b/schala-repl/src/webapp.rs @@ -3,7 +3,7 @@ use rocket::State; use rocket::response::Content; use rocket::http::ContentType; use rocket_contrib::json::Json; -use crate::language::{ProgrammingLanguageInterface, EvalOptions}; +use crate::language::ProgrammingLanguageInterface; use crate::WEBFILES; #[get("/")]