Skip to content

Commit

Permalink
Rename eval.rs to runtime.rs.
Browse files Browse the repository at this point in the history
  • Loading branch information
maloneymr authored and tac-tics committed Jun 4, 2019
1 parent 51aa2b8 commit ee04d92
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/hole.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use rustyline::error::ReadlineError;

use crate::ast;
use crate::eval;
use crate::runtime;
use crate::parser;

use ast::Value;
use ast::HoleInfo;
use ast::Context;
use ast::Def;
use eval::Runtime;
use runtime::Runtime;

pub fn fill(runtime: &mut Runtime, hole_info: &HoleInfo, ctx: Context) -> Value {
match runtime.holes.get_mut(&hole_info.hole_id) {
Expand All @@ -26,7 +26,7 @@ pub fn fill(runtime: &mut Runtime, hole_info: &HoleInfo, ctx: Context) -> Value
Some(Command::Fill(term_text)) => {
match parser::parse_term(&term_text) {
Ok(term) => {
let value = eval::eval(term, ctx.clone(), runtime);
let value = runtime::eval(term, ctx.clone(), runtime);
println!("=> {:?}", &value);
runtime.fill_hole(hole_info.hole_id, value.clone());
return value;
Expand All @@ -37,7 +37,7 @@ pub fn fill(runtime: &mut Runtime, hole_info: &HoleInfo, ctx: Context) -> Value
Some(Command::Eval(term_text)) => {
match parser::parse_term(&term_text) {
Ok(term) => {
let value = eval::eval(term, ctx.clone(), runtime);
let value = runtime::eval(term, ctx.clone(), runtime);
println!("=> {:?}", &value);
},
Err(e) => println!("There was an error {:?}", e),
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod tokenizer;
pub mod parser;
pub mod ast;
pub mod eval;
pub mod runtime;
pub mod typecheck;
pub mod hole;
pub mod builtins;
Expand All @@ -21,6 +21,6 @@ fn main() {
let opt = Opt::from_args();
let filename = opt.filename;
println!("{}", include_str!("../assets/quail.txt"));
let mut runtime = eval::Runtime::load(filename);
let mut runtime = runtime::Runtime::load(filename);
runtime.exec();
}
File renamed without changes.
4 changes: 2 additions & 2 deletions src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#![cfg(test)]
use std::fs;

use crate::eval;
use crate::runtime::Runtime;

#[test]
fn run_examples() {
let paths = fs::read_dir("examples").expect("Could not open examples/ directory");
for path in paths {
let filename = path.expect("Couldn't open file").path();
println!("{:?}", filename);
let mut runtime = eval::Runtime::load(filename);
let mut runtime = Runtime::load(filename);
runtime.exec();
}
}

0 comments on commit ee04d92

Please sign in to comment.