Clean up some unused code

This commit is contained in:
greg 2019-05-20 16:10:50 -07:00
parent ffdae14a88
commit ce2a65b044
2 changed files with 5 additions and 3 deletions

View File

@ -23,7 +23,7 @@ struct ScopeSegment {
#[derive(Debug, Clone)]
enum ScopeSegmentKind {
Function,
Type,
//Type,
}
//cf. p. 150 or so of Language Implementation Patterns

View File

@ -71,7 +71,7 @@ pub enum TypeConst {
StringT,
Bool,
Ordering,
UserDefined
//UserDefined
}
impl TypeConst {
@ -234,6 +234,7 @@ impl<'a> TypeContext<'a> {
}
}
/*
fn new_env(&'a self, new_var: Rc<String>, ty: Type) -> TypeContext<'a> {
let mut new_context = TypeContext {
variable_map: self.variable_map.new_scope(None),
@ -243,12 +244,13 @@ impl<'a> TypeContext<'a> {
new_context.variable_map.insert(new_var, ty);
new_context
}
*/
fn get_type_from_name(&self, name: &TypeIdentifier) -> InferResult<Type> {
use self::TypeIdentifier::*;
Ok(match name {
Singleton(TypeSingletonName { name, params }) => {
Singleton(TypeSingletonName { name,.. }) => {
match Type::from_string(&name) {
Some(ty) => ty,
None => return TypeError::new(format!("Unknown type name: {}", name))