From 36cd7e080d627a75d2454ba2452dde6b85371a0a Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 16 May 2018 01:08:06 -0700 Subject: [PATCH] Even more deletions --- schala-lang/src/builtin.rs | 4 ++-- schala-lang/src/typechecking.rs | 18 +++++------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/schala-lang/src/builtin.rs b/schala-lang/src/builtin.rs index 00a9d8e..4e06032 100644 --- a/schala-lang/src/builtin.rs +++ b/schala-lang/src/builtin.rs @@ -1,8 +1,8 @@ use std::rc::Rc; use std::collections::HashMap; -use typechecking::{Type, TypeResult, TConst}; -use self::Type::*; use self::TConst::*; +use typechecking::{Type, TypeResult, TConstOld}; +use self::Type::*; use self::TConstOld::*; #[derive(Debug, PartialEq, Clone)] pub struct BinOp { diff --git a/schala-lang/src/typechecking.rs b/schala-lang/src/typechecking.rs index 01e99ab..86545fd 100644 --- a/schala-lang/src/typechecking.rs +++ b/schala-lang/src/typechecking.rs @@ -9,7 +9,6 @@ use itertools::Itertools; use parsing; pub struct TypeContext { - //type_var_count: u64, bindings: HashMap, Type>, pub symbol_table: SymbolTable } @@ -42,21 +41,12 @@ pub enum SymbolSpec { #[derive(Debug, PartialEq, Clone)] pub enum Type { - Const(TConst), - Var(TVar), + Const(TConstOld), Func(Box, Box), - //UVar(String), - //EVar(u64), - Sum(Vec), - Void } #[derive(Debug, PartialEq, Clone)] -pub struct TVar(String); - -#[derive(Debug, PartialEq, Clone)] -pub enum TConst { - Unit, +pub enum TConstOld { Nat, Int, Float, @@ -77,16 +67,18 @@ impl parsing::TypeName { fn to_type(&self) -> TypeResult { use self::parsing::TypeSingletonName; use self::parsing::TypeName::*; - use self::Type::*; use self::TConst::*; + use self::Type::*; use self::TConstOld::*; Ok(match self { Tuple(_) => return Err(format!("Tuples not yet implemented")), Singleton(name) => match name { TypeSingletonName { name, .. } => match &name[..] { + /* "Nat" => Const(Nat), "Int" => Const(Int), "Float" => Const(Float), "Bool" => Const(Bool), "String" => Const(StringT), + */ n => Const(Custom(n.to_string())) } }