Skip to content

Commit

Permalink
pub use mods
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaumy committed Nov 19, 2023
1 parent cddaaf4 commit 94144c0
Show file tree
Hide file tree
Showing 38 changed files with 74 additions and 70 deletions.
5 changes: 1 addition & 4 deletions src/eval/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use crate::infer::env::ExprEnv as CtExprEnv;
use crate::infer::env::ExprEnvEntry as CtExprEnvEntry;
use crate::infer::env::TypeConstraint;
use crate::infer::env::TypeEnv as CtTypeEnv;
use crate::infer::infer_type_of_defs::{
infer_type_of_defs,
InferErr
};
use crate::infer::{infer_type_of_defs, InferErr};
use crate::infra::VecExt;
use crate::infra::WrapOption;
use crate::infra::WrapRc;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/apply/fn/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::rc::Rc;

use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::EvalErr;
use crate::eval::Expr;
use crate::eval::Type;
Expand Down
9 changes: 2 additions & 7 deletions src/eval/eval_expr/case/apply/fn/primitive_apply.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
use std::ops::Rem;
use std::rc::Rc;

use super::{bool_expr, eval_to_bool, eval_to_int, int_expr};
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::EvalRet;
use crate::eval::Expr;
use crate::eval::PrimitiveOp;
use crate::infra::WrapOption;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/apply/fn/source_lhs_to_closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;

use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::EvalErr;
use crate::eval::Expr;
use crate::eval::PrimitiveOp;
Expand Down
4 changes: 1 addition & 3 deletions src/eval/eval_expr/case/apply/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ use std::rc::Rc;

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::Expr;
use crate::infra::Either;
use crate::infra::WrapOption;
use crate::infra::WrapRc;

mod r#fn;
pub use r#fn::*;
use r#fn::*;

#[cfg(test)]
mod test;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/apply/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::namely_type;
use crate::eval::Expr;
use crate::eval::PrimitiveOp;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/closure/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::Expr;
use crate::eval::{closure_type, namely_type};
use crate::infra::WrapOption;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/cond/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use std::rc::Rc;

use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::Expr;
use crate::eval::Type;
use crate::eval::{eval_expr, EvalRet};

pub fn case_cond(
type_env: &TypeEnv,
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/cond/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::namely_type;
use crate::eval::Expr;
use crate::infra::WrapRc;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/discard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod test {

use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::namely_type;
use crate::eval::Expr;
use crate::infra::WrapRc;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/env_ref/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::namely_type;
use crate::eval::Expr;
use crate::infra::WrapOption;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn case_int(type_annot: &Type, int_value: &i64) -> EvalRet {
mod test {
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::namely_type;
use crate::eval::Expr;
use crate::infra::WrapRc;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/let/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::namely_type;
use crate::eval::Expr;
use crate::infra::WrapRc;
Expand Down
3 changes: 1 addition & 2 deletions src/eval/eval_expr/case/match/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod r#fn;
pub use r#fn::*;
use r#fn::*;

#[cfg(test)]
mod test;
Expand All @@ -8,7 +8,6 @@ use std::rc::Rc;

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::EvalErr;
use crate::eval::Expr;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/match/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::assert_matches::assert_matches;

use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::namely_type;
use crate::eval::EvalErr;
use crate::eval::Expr;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/primitive_op/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::Expr;
use crate::eval::PrimitiveOp;
use crate::eval::{closure_type, namely_type};
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/struct/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::Expr;
use crate::eval::{namely_type, prod_type};
use crate::infra::WrapRc;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn case_unit(type_annot: &Type) -> EvalRet {
mod test {
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::namely_type;
use crate::eval::Expr;
use crate::infra::WrapRc;
Expand Down
23 changes: 12 additions & 11 deletions src/eval/eval_expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ mod test;

use std::rc::Rc;

use case::case_apply;
use case::case_closure;
use case::case_cond;
use case::case_discard;
use case::case_env_ref;
use case::case_int;
use case::case_let;
use case::case_match;
use case::case_primitive_op;
use case::case_struct;
use case::case_unit;

use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::case::case_apply;
use crate::eval::eval_expr::case::case_closure;
use crate::eval::eval_expr::case::case_cond;
use crate::eval::eval_expr::case::case_discard;
use crate::eval::eval_expr::case::case_env_ref;
use crate::eval::eval_expr::case::case_int;
use crate::eval::eval_expr::case::case_let;
use crate::eval::eval_expr::case::case_match;
use crate::eval::eval_expr::case::case_primitive_op;
use crate::eval::eval_expr::case::case_struct;
use crate::eval::eval_expr::case::case_unit;
use crate::eval::EvalErr;
use crate::eval::Expr;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/test/approx_pi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;
use crate::eval::env::parse_to_env;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::std::std_code;
use crate::infra::WrapRc;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/test/expt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;
use crate::eval::env::parse_to_env;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::std::std_code;
use crate::infra::WrapRc;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/test/fib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;
use crate::eval::env::parse_to_env;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::std::std_code;
use crate::infra::WrapRc;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/test/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;
use crate::eval::env::parse_to_env;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::std::std_code;
use crate::infra::WrapRc;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/test/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;
use crate::eval::env::parse_to_env;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::std::std_code;
use crate::infra::WrapRc;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/test/gcd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;
use crate::eval::env::parse_to_env;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::std::std_code;
use crate::infra::WrapRc;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/test/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;
use crate::eval::env::parse_to_env;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::std::std_code;
use crate::infra::WrapRc;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/test/pi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;
use crate::eval::env::parse_to_env;
use crate::eval::env::ExprEnv;
use crate::eval::env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::eval_expr;
use crate::eval::std::std_code;
use crate::infra::WrapRc;

Expand Down
3 changes: 2 additions & 1 deletion src/eval/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
pub mod env;
pub mod eval_expr;
mod eval_expr;
mod r#macro;
pub mod std;
pub mod r#type;

pub use eval_expr::*;
pub use r#macro::*;
pub use r#type::*;
5 changes: 3 additions & 2 deletions src/infer/infer_type/case/apply/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ mod test;
use std::ops::Deref;
use std::rc::Rc;

use case_ri::case_ri;
use case_t_rc::case_t_rc;

use crate::infer::env::ExprEnv;
use crate::infer::env::TypeEnv;
use crate::infer::infer_type::case::apply::case_ri::case_ri;
use crate::infer::infer_type::case::apply::case_t_rc::case_t_rc;
use crate::infer::infer_type::InferTypeRet;
use crate::infer::infer_type::TypeMissMatch;
use crate::infra::Triple;
Expand Down
5 changes: 3 additions & 2 deletions src/infer/infer_type/case/closure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ mod test;
use std::ops::Deref;
use std::rc::Rc;

use has_input_type::has_input_type;
use no_input_type::no_input_type;

use crate::infer::env::ExprEnv;
use crate::infer::env::TypeEnv;
use crate::infer::infer_type::case::closure::has_input_type::has_input_type;
use crate::infer::infer_type::case::closure::no_input_type::no_input_type;
use crate::infer::infer_type::r#fn::destruct_namely_type;
use crate::infer::infer_type::InferTypeRet;
use crate::infer::infer_type::ReqInfo;
Expand Down
8 changes: 5 additions & 3 deletions src/infer/infer_type/case/cond/infer_branch_type/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ mod case_ri;
mod case_t_rc;

use std::rc::Rc;

use case_ri::case_ri;
use case_t_rc::case_t_rc;

use crate::infer::env::ExprEnv;
use crate::infer::env::TypeEnv;
use crate::infer::infer_type::case::cond::infer_branch_type::case_ri::case_ri;
use crate::infer::infer_type::case::cond::infer_branch_type::case_t_rc::case_t_rc;
use crate::infer::infer_type::InferTypeRet;
use crate::infra::Triple;
use crate::infra::WrapOption;
use crate::infra::WrapRc;
use crate::infra::Triple;
use crate::parser::expr::r#type::Expr;
use crate::parser::r#type::OptType;

Expand Down
3 changes: 2 additions & 1 deletion src/infer/infer_type/case/cond/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ mod test;

use std::rc::Rc;

use infer_branch_type::infer_branch_type;

use crate::infer::env::bool_type;
use crate::infer::env::ExprEnv;
use crate::infer::env::TypeEnv;
use crate::infer::infer_type::case::cond::infer_branch_type::infer_branch_type;
use crate::infer::infer_type::InferTypeRet;
use crate::infer::infer_type::ReqConstraint;
use crate::infer::infer_type::ReqInfo;
Expand Down
5 changes: 3 additions & 2 deletions src/infer/infer_type/case/let/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ mod test;

use std::rc::Rc;

use case_ri::case_ri;
use case_t_rc::case_t_rc;

use crate::infer::env::ExprEnv;
use crate::infer::env::TypeEnv;
use crate::infer::infer_type::case::r#let::case_ri::case_ri;
use crate::infer::infer_type::case::r#let::case_t_rc::case_t_rc;
use crate::infer::infer_type::InferTypeRet;
use crate::infer::infer_type::TypeMissMatch;
use crate::infra::Triple;
Expand Down
2 changes: 1 addition & 1 deletion src/infer/infer_type/case/match/case_ri.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::rc::Rc;

use super::r#fn::destruct_match_const_to_expr_env_inject;
use crate::infer::env::ExprEnv;
use crate::infer::env::TypeEnv;
use crate::infer::infer_type::case::r#match::r#fn::destruct_match_const_to_expr_env_inject;
use crate::infer::infer_type::InferTypeRet;
use crate::infer::infer_type::ReqInfo;
use crate::infer::infer_type::TypeMissMatch;
Expand Down
Loading

0 comments on commit 94144c0

Please sign in to comment.