Skip to content
Snippets Groups Projects
Unverified Commit 81400f94 authored by Louis's avatar Louis :fire:
Browse files

Clear out old scripting code and comments

parent d47d1266
No related branches found
No related tags found
1 merge request!2Scripting
......@@ -502,11 +502,6 @@ dependencies = [
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rhai"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "ring"
version = "0.11.0"
......@@ -646,7 +641,6 @@ dependencies = [
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
"interpolate_idents 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"rhai 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rocket 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rocket_codegen 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rocket_contrib 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -900,7 +894,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "aec3f58d903a7d2a9dc2bf0e41a746f4530e0cab6b615494e058f67a3ef947fb"
"checksum regex-syntax 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "bd90079345f4a4c3409214734ae220fd773c6f2e8a543d07370c6c1c369cfbfb"
"checksum remove_dir_all 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfc5b3ce5d5ea144bb04ebd093a9e14e9765bcfec866aecda9b6dec43b3d1e24"
"checksum rhai 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7d8dd1945cb3f6c777074814bb2856a8fce36af4d6aa6f479c6a3029869e865b"
"checksum ring 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2a6dc7fc06a05e6de183c5b97058582e9da2de0c136eafe49609769c507724"
"checksum rocket 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c000cf7233aa997a19a43f77ddc80db11b58cdbbc12e2c1385bd62cbbace3964"
"checksum rocket_codegen 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "645dd494d1340a4c16ba8decc4bb94d3e687a7e6b57552e2341dbf436b75ffaa"
......
......@@ -35,7 +35,6 @@ docopt = "0.8"
formdata = "0.12.2"
hyper = "0.10"
rand = "0.3"
rhai = "0.7"
serde_yaml = "0.7.3"
[dev-dependencies]
......
......@@ -4,7 +4,6 @@
extern crate serde;
#[macro_use] extern crate serde_derive;
extern crate serde_yaml;
extern crate rhai;
extern crate rocket;
extern crate rocket_contrib;
extern crate formdata;
......
......@@ -6,7 +6,6 @@ extern crate alloc_system;
extern crate rocket;
extern crate docopt;
extern crate swerve;
extern crate rhai;
use std::process;
use docopt::Docopt;
......
//use dyon::{Runtime,Module,load_str,Variable,Dfn,Type};
//use dyon::ast::convert;
use std::convert::AsRef;
use std::path::Path;
use std::fs::File;
......@@ -7,40 +5,10 @@ use std::sync::Arc;
use std::io::Read;
use std::collections::HashMap;
const SCRIPT_FOOTER: &'static str = "
fn main() {
println(\"Don't directly execute the module, nimrod\")
}";
pub fn run_script<P: AsRef<Path>>(path: P) -> Option<String> {
// let mut resolution: Option<Variable> = None;
// dyon_fn!(fn resolve(val: Variable) {
// resolution = Some(val); // if let Ok(val) = runtime.pop() { Some(val) } else { None };
// });
//
// println!("{:?}", resolution);
let mut file = File::open(&path).unwrap();
let mut buf = String::new();
file.read_to_string(&mut buf);
buf.push_str(SCRIPT_FOOTER);
// let mut script_module = Module::new();
//
// {
// load_str(path.as_ref().to_str().unwrap(), Arc::new(buf), &mut script_module);
// }
Some(buf)
// script_module.add(Arc::new("resolve".into()), resolve, Dfn {
// lts: vec![],
// tys: vec![Type::Object],
// ret: Type::Void,
// });
//
// let mut hashmap: HashMap<Arc<String>, Variable> = HashMap::new();
// runtime.call_str("handle", &[Variable::f64(123f64)], &Arc::new(script_module));
// None
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment