Skip to content

Commit

Permalink
Minor preparatory refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
VonTum committed Sep 15, 2024
1 parent f57e403 commit 211e0d9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sus_compiler"
description = "Compiler for the SUS Hardware Design Language"
version = "0.0.2"
version = "0.0.2-dev"
authors = ["Lennart Van Hirtum <[email protected]>"]
edition = "2021"
license = "GPL-3.0-or-later"
Expand All @@ -22,7 +22,7 @@ members = [
# chumsky = "0.9.2"
ariadne = "0.4.1" # for nice errors
num = "0.4"
itertools = "0.13.0"
# itertools = "0.13.0"
clap = "3.2"

# Tree sitter
Expand Down
1 change: 0 additions & 1 deletion src/flattening/typechecking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ impl<'l, 'errs> TypeCheckingContext<'l, 'errs> {
/// outside of a condition block
fn join_with_condition(&self, ref_domain: &DomainType, span: Span) {
if let Some(condition_domain) = self.get_current_condition_domain() {
// Just check that
self.type_checker.combine_domains::<false, _>(ref_domain, &DomainType::Physical(condition_domain.0), |wire_ref_domain_name, condition_domain_name| {
let wire_ref_domain_name = wire_ref_domain_name.unwrap();
self.errors.error(span, format!("Attempting to write to a wire from domain '{wire_ref_domain_name}' within a condition in domain '{condition_domain_name}'"))
Expand Down
1 change: 1 addition & 0 deletions src/typing/abstract_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ impl<'linker, 'errs> TypeUnifier<'linker, 'errs> {

// ===== Both =====

/// Unify the given full type [found] with the expected type [expected].
pub fn typecheck_and_generative<const MUST_BE_GENERATIVE: bool>(
&self,
found: &FullType,
Expand Down
10 changes: 4 additions & 6 deletions src/typing/type_inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

use std::cell::OnceCell;

use itertools::Itertools;

use crate::prelude::*;

use crate::alloc::{UUIDMarker, UUID};
Expand All @@ -15,8 +13,8 @@ impl UUIDMarker for TypeVariableIDMarker {
pub type TypeVariableID = UUID<TypeVariableIDMarker>;

#[derive(Debug, Clone, Copy)]
enum HindleyMilnerInfo<TypeFuncIdent> {
/// Just a marker. Use [HindleyMilner::type_func_for_each_matching]
pub enum HindleyMilnerInfo<TypeFuncIdent> {
/// Just a marker. Use [HindleyMilner::unify_all_args]
TypeFunc(TypeFuncIdent),
TypeVar(TypeVariableID),
/// Used for errors. Just returning Ok(()) prevents type errors from propagating
Expand Down Expand Up @@ -105,8 +103,8 @@ impl HindleyMilner<AbstractTypeHMInfo> for AbstractType {
fn fully_substitute(&mut self, substitution_map: &FlatAlloc<OnceCell<Self>, TypeVariableIDMarker>) {
match self {
AbstractType::Error => {}
AbstractType::Template(_) => {}
AbstractType::Named(_) => {}
AbstractType::Template(_) => {} // Template Name is included in get_hm_info
AbstractType::Named(_) => {} // Name is included in get_hm_info
AbstractType::Array(arr_typ) => {
arr_typ.fully_substitute(substitution_map);
},
Expand Down

0 comments on commit 211e0d9

Please sign in to comment.