From 6368d10d92edea98da3d08d3e2624d17f5cdef07 Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 24 Sep 2019 18:56:53 -0700 Subject: [PATCH] Rename Symbol.name -> Symbol.local_name to make it clearer what this means --- schala-lang/language/src/eval.rs | 4 ++-- schala-lang/language/src/symbol_table.rs | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/schala-lang/language/src/eval.rs b/schala-lang/language/src/eval.rs index 192f1f6..0f86731 100644 --- a/schala-lang/language/src/eval.rs +++ b/schala-lang/language/src/eval.rs @@ -469,11 +469,11 @@ impl<'a> State<'a> { let symbol_table = self.symbol_table_handle.borrow(); let value = symbol_table.lookup_by_fqsn(&fqsn!(name ; tr)); Ok(match value { - Some(Symbol { name, spec, .. }) => match spec { + Some(Symbol { local_name, spec, .. }) => match spec { //TODO I'll need this type_name later to do a table lookup SymbolSpec::DataConstructor { type_name: _type_name, type_args, .. } => { if type_args.len() == 0 { - Node::PrimObject { name: name.clone(), tag: 0, items: vec![] } + Node::PrimObject { name: local_name.clone(), tag: 0, items: vec![] } } else { return Err(format!("This data constructor thing not done")) } diff --git a/schala-lang/language/src/symbol_table.rs b/schala-lang/language/src/symbol_table.rs index d2fee74..bc4acfa 100644 --- a/schala-lang/language/src/symbol_table.rs +++ b/schala-lang/language/src/symbol_table.rs @@ -53,6 +53,7 @@ pub enum ScopeSegmentKind { Function, Type, Terminal, + //Module } #[allow(unused_macros)] @@ -105,7 +106,7 @@ impl SymbolTable { let mut vec: Vec = scope_path.clone(); vec.push(ScopeSegment { name: name.clone(), kind: ScopeSegmentKind::Terminal }); let fully_qualified_name = FullyQualifiedSymbolName(vec); - let symbol = Symbol { name: name.clone(), fully_qualified_name: fully_qualified_name.clone(), spec }; + let symbol = Symbol { local_name: name.clone(), fully_qualified_name: fully_qualified_name.clone(), spec }; self.symbol_path_to_symbol.insert(fully_qualified_name, symbol); } @@ -116,14 +117,14 @@ impl SymbolTable { #[derive(Debug)] pub struct Symbol { - pub name: Rc, //TODO does this need to be pub? + pub local_name: Rc, //TODO does this need to be pub? fully_qualified_name: FullyQualifiedSymbolName, pub spec: SymbolSpec, } impl fmt::Display for Symbol { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "", self.name, self.spec) + write!(f, "", self.local_name, self.spec) } }