Skip to content

Commit

Permalink
pub use eval mods
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaumy committed Nov 18, 2023
1 parent ad2b293 commit f72034e
Show file tree
Hide file tree
Showing 39 changed files with 133 additions and 131 deletions.
4 changes: 2 additions & 2 deletions src/eval/env/expr_env.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::rc::Rc;

use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::eval::Expr;
use crate::eval::Type;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;

Expand Down
13 changes: 7 additions & 6 deletions src/eval/env/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashMap;
use std::rc::Rc;

use crate::eval::env::expr_env::{ExprEnv, ExprEnvEntry};
use crate::eval::env::type_env::{TypeEnv, TypeEnvEntry};
use crate::eval::r#type::OptExpr;
use crate::eval::r#type::OptType;
use crate::eval::OptExpr;
use crate::eval::OptType;
use crate::infer::env::def_map_to_env_vec as def_map_to_ct_env_vec;
use crate::infer::env::def_vec_to_def_map;
use crate::infer::env::expr_env::ExprEnv as CtExprEnv;
Expand All @@ -31,8 +29,11 @@ use crate::parser::r#type::r#type::{
};
use crate::pp::preprocess;

pub mod expr_env;
pub mod type_env;
mod expr_env;
mod type_env;

pub use expr_env::*;
pub use type_env::*;

fn ct_expr_env_vec_to_rt_expr_env_vec(
ct_type_env: CtTypeEnv,
Expand Down
2 changes: 1 addition & 1 deletion src/eval/env/type_env.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::BTreeSet;

use crate::eval::r#type::Type;
use crate::eval::Type;
use crate::infra::option::WrapOption;

pub type TypeEnvEntry = (String, Type);
Expand Down
10 changes: 5 additions & 5 deletions src/eval/eval_expr/case/apply/fn/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::eval::EvalErr;
use crate::eval::Expr;
use crate::eval::Type;
use crate::eval::{false_type, namely_type, true_type};
use crate::infra::result::WrapResult;

Expand Down
8 changes: 4 additions & 4 deletions src/eval/eval_expr/case/apply/fn/primitive_apply.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use std::ops::Rem;
use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::case::apply::{
bool_expr,
eval_to_bool,
eval_to_int,
int_expr
};
use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::eval::Expr;
use crate::eval::PrimitiveOp;
use crate::infra::option::WrapOption;
use crate::infra::result::WrapResult;

Expand Down
12 changes: 6 additions & 6 deletions src/eval/eval_expr/case/apply/fn/source_lhs_to_closure.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::ops::Deref;
use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::eval::r#type::Type;
use crate::eval::EvalErr;
use crate::eval::Expr;
use crate::eval::PrimitiveOp;
use crate::eval::Type;
use crate::infra::either::{Either, EitherAnyExt};
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/apply/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::case::apply::primitive_apply;
use crate::eval::eval_expr::case::apply::source_lhs_expr_to_closure;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::Expr;
use crate::eval::Expr;
use crate::infra::either::Either;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
Expand Down
8 changes: 4 additions & 4 deletions src/eval/eval_expr/case/apply/test.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::namely_type;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::eval::Expr;
use crate::eval::PrimitiveOp;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/closure/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::ExprEnv;
use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::eval::Expr;
use crate::eval::Type;
use crate::infra::option::WrapOption;
use crate::infra::result::WrapResult;

Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/closure/test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#type::Expr;
use crate::eval::Expr;
use crate::eval::{closure_type, namely_type};
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
Expand Down
8 changes: 4 additions & 4 deletions src/eval/eval_expr/case/cond/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ mod test;

use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::eval::Expr;
use crate::eval::Type;

pub fn case_cond(
type_env: &TypeEnv,
Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/cond/test.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::namely_type;
use crate::eval::r#type::Expr;
use crate::eval::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
10 changes: 5 additions & 5 deletions src/eval/eval_expr/case/discard.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Type;
use crate::eval::EvalErr;
use crate::eval::Type;
use crate::infra::result::WrapResult;

pub fn case_discard(type_annot: &Type) -> EvalRet {
Expand All @@ -12,11 +12,11 @@ pub fn case_discard(type_annot: &Type) -> EvalRet {
mod test {
use std::assert_matches::assert_matches;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::namely_type;
use crate::eval::r#type::Expr;
use crate::eval::Expr;
use crate::infra::rc::RcAnyExt;

// _: Int
Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/env_ref/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ mod test;

use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::EvalErr;
use crate::eval::EvalErr;
use crate::infra::result::WrapResult;

pub fn case_env_ref(
Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/env_ref/test.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::namely_type;
use crate::eval::r#type::Expr;
use crate::eval::Expr;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
10 changes: 5 additions & 5 deletions src/eval/eval_expr/case/int.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::eval::Expr;
use crate::eval::Type;
use crate::infra::result::WrapResult;

pub fn case_int(type_annot: &Type, int_value: &i64) -> EvalRet {
Expand All @@ -9,11 +9,11 @@ pub fn case_int(type_annot: &Type, int_value: &i64) -> EvalRet {

#[cfg(test)]
mod test {
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::namely_type;
use crate::eval::r#type::Expr;
use crate::eval::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
8 changes: 4 additions & 4 deletions src/eval/eval_expr/case/let/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ mod test;

use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::eval::Expr;
use crate::eval::Type;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;

Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/let/test.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::namely_type;
use crate::eval::r#type::Expr;
use crate::eval::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/match/fn.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::rc::Rc;

use crate::eval::env::expr_env::{ExprEnv, ExprEnvEntry};
use crate::eval::env::type_env::TypeEnv;
use crate::eval::r#type::{Expr, StructField};
use crate::eval::env::TypeEnv;
use crate::eval::env::{ExprEnv, ExprEnvEntry};
use crate::eval::{Expr, StructField};
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;

Expand Down
8 changes: 4 additions & 4 deletions src/eval/eval_expr/case/match/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ mod test;

use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::case::r#match::is_expr_match_pattern_then_env;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Expr;
use crate::eval::EvalErr;
use crate::eval::Expr;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
8 changes: 4 additions & 4 deletions src/eval/eval_expr/case/match/test.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::assert_matches::assert_matches;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::namely_type;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Expr;
use crate::eval::EvalErr;
use crate::eval::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/primitive_op/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::rc::Rc;

use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::eval::r#type::Type;
use crate::eval::Expr;
use crate::eval::PrimitiveOp;
use crate::eval::Type;
use crate::infra::result::WrapResult;

#[cfg(test)]
Expand Down
8 changes: 4 additions & 4 deletions src/eval/eval_expr/case/primitive_op/test.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::eval::Expr;
use crate::eval::PrimitiveOp;
use crate::eval::{closure_type, namely_type};
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
Expand Down
10 changes: 5 additions & 5 deletions src/eval/eval_expr/case/struct/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ mod test;

use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Type;
use crate::eval::r#type::{Expr, StructField};
use crate::eval::EvalErr;
use crate::eval::Type;
use crate::eval::{Expr, StructField};
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
use crate::infra::vec::VecExt;
Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/struct/test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#type::Expr;
use crate::eval::Expr;
use crate::eval::{namely_type, prod_type};
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
Loading

0 comments on commit f72034e

Please sign in to comment.