From 6825de391680ea781de9dd3fb95b7d44a2dece5b Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 14 Aug 2018 21:45:45 -0700 Subject: [PATCH] new_frame -> new_scope --- schala-lang/src/eval.rs | 4 ++-- schala-lang/src/util.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/schala-lang/src/eval.rs b/schala-lang/src/eval.rs index 89e7c26..0561c46 100644 --- a/schala-lang/src/eval.rs +++ b/schala-lang/src/eval.rs @@ -218,7 +218,7 @@ impl<'a> State<'a> { for alt in alternatives { if alt.tag.map(|t| t == tag).unwrap_or(true) { let mut inner_state = State { - values: self.values.new_frame(None), + values: self.values.new_scope(None), symbol_table_handle: self.symbol_table_handle.clone(), }; for (bound_var, val) in alt.bound_vars.iter().zip(items.iter()) { @@ -262,7 +262,7 @@ impl<'a> State<'a> { return Err(format!("calling a {}-argument function with {} args", params.len(), args.len())) } let mut func_state = State { - values: self.values.new_frame(name.map(|n| format!("{}", n))), + values: self.values.new_scope(name.map(|n| format!("{}", n))), symbol_table_handle: self.symbol_table_handle.clone(), }; for (param, val) in params.into_iter().zip(args.into_iter()) { diff --git a/schala-lang/src/util.rs b/schala-lang/src/util.rs index 0e8cadf..e9df6b5 100644 --- a/schala-lang/src/util.rs +++ b/schala-lang/src/util.rs @@ -29,7 +29,7 @@ impl<'a, T, V> StateStack<'a, T, V> where T: Hash + Eq { } } //TODO rename new_scope - pub fn new_frame(&'a self, name: Option) -> StateStack<'a, T, V> where T: Hash + Eq { + pub fn new_scope(&'a self, name: Option) -> StateStack<'a, T, V> where T: Hash + Eq { StateStack { parent: Some(self), values: HashMap::default(),