Make LocalInfo and CompilerScope fields public
This commit is contained in:
@@ -9,22 +9,22 @@ use std::collections::HashMap;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct LocalInfo {
|
||||
addr: Address,
|
||||
identity: Identity,
|
||||
pub struct LocalInfo {
|
||||
pub addr: Address,
|
||||
pub identity: Identity,
|
||||
// Note: Binder doesn't strictly need the type anymore,
|
||||
// but it might be useful for built-ins during resolution.
|
||||
// For now we keep it as Any or Unknown.
|
||||
_ty: StaticType,
|
||||
pub _ty: StaticType,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct CompilerScope {
|
||||
locals: HashMap<Symbol, LocalInfo>,
|
||||
pub struct CompilerScope {
|
||||
pub locals: HashMap<Symbol, LocalInfo>,
|
||||
}
|
||||
|
||||
impl CompilerScope {
|
||||
fn new() -> Self {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
locals: HashMap::new(),
|
||||
}
|
||||
@@ -41,7 +41,11 @@ struct FunctionCompiler {
|
||||
}
|
||||
|
||||
impl FunctionCompiler {
|
||||
fn new(fixed_scope_idx: i32, identity: Identity, is_root: bool) -> Self {
|
||||
fn new(
|
||||
fixed_scope_idx: i32,
|
||||
identity: Identity,
|
||||
is_root: bool,
|
||||
) -> Self {
|
||||
Self {
|
||||
identity,
|
||||
scopes: vec![CompilerScope::new()],
|
||||
|
||||
Reference in New Issue
Block a user