Symbol table notes to self
This commit is contained in:
parent
d9eca8ffb3
commit
b65d6e4c8e
@ -178,6 +178,7 @@ impl SymbolTable {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO handle type mutability
|
||||||
fn add_type_decl(&mut self, type_name: &TypeSingletonName, body: &TypeBody, _mutable: &bool, scope_name_stack: &mut Vec<ScopeSegment>) -> Result<(), String> {
|
fn add_type_decl(&mut self, type_name: &TypeSingletonName, body: &TypeBody, _mutable: &bool, scope_name_stack: &mut Vec<ScopeSegment>) -> Result<(), String> {
|
||||||
use crate::ast::{TypeIdentifier, Variant};
|
use crate::ast::{TypeIdentifier, Variant};
|
||||||
let TypeBody(variants) = body;
|
let TypeBody(variants) = body;
|
||||||
@ -208,8 +209,6 @@ impl SymbolTable {
|
|||||||
};
|
};
|
||||||
self.add_new_symbol(variant_name, scope_name_stack, spec);
|
self.add_new_symbol(variant_name, scope_name_stack, spec);
|
||||||
},
|
},
|
||||||
//TODO if there is only one variant, and it is a record, it doesn't need to have an
|
|
||||||
//explicit name
|
|
||||||
Variant::Record { name, members: defined_members } => {
|
Variant::Record { name, members: defined_members } => {
|
||||||
let mut members = HashMap::new();
|
let mut members = HashMap::new();
|
||||||
let mut duplicate_member_definitions = Vec::new();
|
let mut duplicate_member_definitions = Vec::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user