Add function to symbol table

This commit is contained in:
greg 2018-05-13 15:54:15 -07:00
parent aff421cd99
commit 6d93c758a2
1 changed files with 6 additions and 3 deletions

View File

@ -27,8 +27,8 @@ impl SymbolTable {
#[derive(Debug)] #[derive(Debug)]
struct Symbol { struct Symbol {
name: Rc<String>, pub name: Rc<String>,
ty: Type pub ty: Type
} }
#[derive(Debug, PartialEq, Clone)] #[derive(Debug, PartialEq, Clone)]
@ -142,7 +142,10 @@ impl TypeContext {
} }
self.bindings.insert(signature.name.clone(), ty); self.bindings.insert(signature.name.clone(), ty);
//self.symbol_table.values.insert(); self.symbol_table.values.insert(
signature.name.clone(),
Symbol { name: signature.name.clone(), ty: Func(Box::new(Void), Box::new(Void)) }
);
}, },
TypeDecl(TypeSingletonName { name, ..}, TypeBody(variants)) => { TypeDecl(TypeSingletonName { name, ..}, TypeBody(variants)) => {
for var in variants { for var in variants {