new_frame -> new_scope
This commit is contained in:
parent
1b78fbff82
commit
6825de3916
@ -218,7 +218,7 @@ impl<'a> State<'a> {
|
|||||||
for alt in alternatives {
|
for alt in alternatives {
|
||||||
if alt.tag.map(|t| t == tag).unwrap_or(true) {
|
if alt.tag.map(|t| t == tag).unwrap_or(true) {
|
||||||
let mut inner_state = State {
|
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(),
|
symbol_table_handle: self.symbol_table_handle.clone(),
|
||||||
};
|
};
|
||||||
for (bound_var, val) in alt.bound_vars.iter().zip(items.iter()) {
|
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()))
|
return Err(format!("calling a {}-argument function with {} args", params.len(), args.len()))
|
||||||
}
|
}
|
||||||
let mut func_state = State {
|
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(),
|
symbol_table_handle: self.symbol_table_handle.clone(),
|
||||||
};
|
};
|
||||||
for (param, val) in params.into_iter().zip(args.into_iter()) {
|
for (param, val) in params.into_iter().zip(args.into_iter()) {
|
||||||
|
@ -29,7 +29,7 @@ impl<'a, T, V> StateStack<'a, T, V> where T: Hash + Eq {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO rename new_scope
|
//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 {
|
StateStack {
|
||||||
parent: Some(self),
|
parent: Some(self),
|
||||||
values: HashMap::default(),
|
values: HashMap::default(),
|
||||||
|
Loading…
Reference in New Issue
Block a user