use crate::ast::typename::TypeInfo;
use std::collections::HashMap;
#[derive(Default, Debug)]
pub struct Scope {
pub type_infos: HashMap<String, TypeInfo>,
pub variables: HashMap<String, (TypeInfo, isize)>,
pub declared_variable_count: usize,
}
impl Scope {
pub fn new() -> Self {
Self {
type_infos: HashMap::new(),
variables: HashMap::new(),
declared_variable_count: 0,
}
}
}
#[derive(Debug, Default)]
pub struct FunctionScope {
pub declared_variable_count: usize,
pub max_variable_count: usize,
}
impl FunctionScope {
pub fn new() -> Self {
Self {
declared_variable_count: 0,
max_variable_count: 0,
}
}
}