use crate::symbol::parameter_symbol::ParameterSymbol; use std::collections::HashMap; use std::fmt::{Debug, Formatter}; use std::rc::Rc; pub struct FunctionScope { debug_name: String, parent_id: usize, parameter_symbols: HashMap, Rc>, } impl FunctionScope { pub fn new(debug_name: &str, parent_id: usize) -> Self { Self { debug_name: debug_name.into(), parent_id, parameter_symbols: HashMap::new(), } } pub fn parameter_symbols(&self) -> &HashMap, Rc> { &self.parameter_symbols } pub fn parameter_symbols_mut(&mut self) -> &mut HashMap, Rc> { &mut self.parameter_symbols } pub fn parent_id(&self) -> usize { self.parent_id } } impl Debug for FunctionScope { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "FunctionScope({}, {})", self.debug_name, self.parent_id) } }