From c405e46b00c45241dab2c8e61c7efd9276d9d92a Mon Sep 17 00:00:00 2001 From: pca006132 Date: Sat, 7 Aug 2021 10:28:41 +0800 Subject: [PATCH] moving location and symbol_resolver out from typecheck --- nac3core/src/lib.rs | 2 ++ nac3core/src/{typecheck => }/location.rs | 0 nac3core/src/{typecheck => }/symbol_resolver.rs | 4 ++-- nac3core/src/top_level.rs | 2 +- nac3core/src/typecheck/mod.rs | 2 -- nac3core/src/typecheck/type_inferencer/mod.rs | 2 +- nac3core/src/typecheck/type_inferencer/test.rs | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) rename nac3core/src/{typecheck => }/location.rs (100%) rename nac3core/src/{typecheck => }/symbol_resolver.rs (90%) diff --git a/nac3core/src/lib.rs b/nac3core/src/lib.rs index 8d6db7136..6d7de6f59 100644 --- a/nac3core/src/lib.rs +++ b/nac3core/src/lib.rs @@ -2,5 +2,7 @@ #![allow(dead_code)] mod codegen; +mod location; +mod symbol_resolver; mod top_level; mod typecheck; diff --git a/nac3core/src/typecheck/location.rs b/nac3core/src/location.rs similarity index 100% rename from nac3core/src/typecheck/location.rs rename to nac3core/src/location.rs diff --git a/nac3core/src/typecheck/symbol_resolver.rs b/nac3core/src/symbol_resolver.rs similarity index 90% rename from nac3core/src/typecheck/symbol_resolver.rs rename to nac3core/src/symbol_resolver.rs index fd2ad3f4e..1c9f80c7b 100644 --- a/nac3core/src/typecheck/symbol_resolver.rs +++ b/nac3core/src/symbol_resolver.rs @@ -1,5 +1,5 @@ -use super::location::Location; -use super::typedef::Type; +use crate::location::Location; +use crate::typecheck::typedef::Type; use crate::top_level::DefinitionId; use rustpython_parser::ast::Expr; diff --git a/nac3core/src/top_level.rs b/nac3core/src/top_level.rs index a861e7913..ef2651cd6 100644 --- a/nac3core/src/top_level.rs +++ b/nac3core/src/top_level.rs @@ -1,8 +1,8 @@ use std::{collections::HashMap, sync::Arc}; -use super::typecheck::symbol_resolver::SymbolResolver; use super::typecheck::type_inferencer::PrimitiveStore; use super::typecheck::typedef::{SharedUnifier, Type, Unifier}; +use crate::symbol_resolver::SymbolResolver; use inkwell::{builder::Builder, context::Context, module::Module, values::PointerValue}; use parking_lot::RwLock; use rustpython_parser::ast::Stmt; diff --git a/nac3core/src/typecheck/mod.rs b/nac3core/src/typecheck/mod.rs index e79cb65a3..a75222f52 100644 --- a/nac3core/src/typecheck/mod.rs +++ b/nac3core/src/typecheck/mod.rs @@ -1,7 +1,5 @@ mod function_check; -pub mod location; mod magic_methods; -pub mod symbol_resolver; pub mod type_inferencer; pub mod typedef; mod unification_table; diff --git a/nac3core/src/typecheck/type_inferencer/mod.rs b/nac3core/src/typecheck/type_inferencer/mod.rs index 95ea20274..a3e16bfb2 100644 --- a/nac3core/src/typecheck/type_inferencer/mod.rs +++ b/nac3core/src/typecheck/type_inferencer/mod.rs @@ -4,8 +4,8 @@ use std::iter::once; use std::{cell::RefCell, sync::Arc}; use super::magic_methods::*; -use super::symbol_resolver::SymbolResolver; use super::typedef::{Call, FunSignature, FuncArg, Type, TypeEnum, Unifier}; +use crate::symbol_resolver::SymbolResolver; use itertools::izip; use rustpython_parser::ast::{ self, diff --git a/nac3core/src/typecheck/type_inferencer/test.rs b/nac3core/src/typecheck/type_inferencer/test.rs index d88fe6d46..76b7515ca 100644 --- a/nac3core/src/typecheck/type_inferencer/test.rs +++ b/nac3core/src/typecheck/type_inferencer/test.rs @@ -1,7 +1,7 @@ -use super::super::location::Location; -use super::super::symbol_resolver::*; use super::super::typedef::*; use super::*; +use crate::location::Location; +use crate::symbol_resolver::*; use crate::top_level::DefinitionId; use indoc::indoc; use itertools::zip;