From 4b805823e6ed16407999191281190f108174f75d Mon Sep 17 00:00:00 2001 From: azur Date: Sat, 1 Apr 2023 15:20:52 +0700 Subject: [PATCH] rename `TypeEnv` --- src/typing/check.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/typing/check.rs b/src/typing/check.rs index 55b09fb..cd08ce5 100644 --- a/src/typing/check.rs +++ b/src/typing/check.rs @@ -5,12 +5,12 @@ use crate::parse::parser::{ use super::{ty::Type, typed::TExpr}; #[derive(Clone, Debug)] -struct TypeEnv<'src> { +struct TypeContext<'src> { bindings: Vec<(&'src str, Type)>, funcs: Vec<(&'src str, Vec, Type)>, } -impl<'src> TypeEnv<'src> { +impl<'src> TypeContext<'src> { fn new() -> Self { Self { bindings: Vec::new(), @@ -73,7 +73,7 @@ impl TypeError { } fn type_expr<'src>( - env: &mut TypeEnv<'src>, expr: Spanned> + env: &mut TypeContext<'src>, expr: Spanned> ) -> Result>, TypeError> { macro_rules! oks { // Spanned Ok macro. ($e:expr $(,)?) => { @@ -415,7 +415,7 @@ fn type_expr<'src>( } pub fn check(es: Vec>>) -> Result>>, TypeError> { - let mut env = TypeEnv::new(); + let mut env = TypeContext::new(); let mut tes = Vec::new(); for e in es { let te = type_expr(&mut env, e)?;