new_frame -> new_scope

This commit is contained in:
greg 2018-08-14 21:45:45 -07:00
parent 1b78fbff82
commit 6825de3916
2 changed files with 3 additions and 3 deletions

View File

@ -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()) {

View File

@ -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<String>) -> StateStack<'a, T, V> where T: Hash + Eq {
pub fn new_scope(&'a self, name: Option<String>) -> StateStack<'a, T, V> where T: Hash + Eq {
StateStack {
parent: Some(self),
values: HashMap::default(),