Get rid of EvalOptions

and associated types
This commit is contained in:
greg 2019-03-19 18:40:21 -07:00
parent 4319c802f5
commit 14c08bbcdb
5 changed files with 4 additions and 22 deletions

View File

@ -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) }

View File

@ -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;

View File

@ -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";

View File

@ -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};

View File

@ -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("/")]