Get rid of EvalOptions
and associated types
This commit is contained in:
parent
4319c802f5
commit
14c08bbcdb
@ -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) }
|
||||
|
@ -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;
|
||||
|
@ -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";
|
||||
|
@ -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};
|
||||
|
||||
|
@ -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("/")]
|
||||
|
Loading…
Reference in New Issue
Block a user