From 5aa0e10e7a149c8f1095943b2007eb498630d5d2 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 4 Jun 2018 19:04:51 -0700 Subject: [PATCH] Some ADT work --- schala-lang/src/symbol_table.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/schala-lang/src/symbol_table.rs b/schala-lang/src/symbol_table.rs index e584ce9..bbbccd6 100644 --- a/schala-lang/src/symbol_table.rs +++ b/schala-lang/src/symbol_table.rs @@ -83,7 +83,6 @@ impl SymbolTable { for var in variants { match var { Variant::UnitStruct(variant_name) => { - //TODO will have to make this a function to this type eventually let spec = SymbolSpec::DataConstructor { type_name: name.clone(), type_args: vec![], @@ -91,9 +90,10 @@ impl SymbolTable { self.values.insert(variant_name.clone(), Symbol { name: variant_name.clone(), spec }); }, Variant::TupleStruct(variant_name, tuple_members) => { - let type_args = vec![ - - ]; + let type_args = tuple_members.iter().map(|type_name| match type_name { + TypeName::Singleton(TypeSingletonName { name, ..}) => name.clone(), + TypeName::Tuple(_) => unimplemented!(), + }).collect(); let spec = SymbolSpec::DataConstructor { type_name: name.clone(), type_args