Add convenience constructor
This commit is contained in:
parent
72db7c448b
commit
dfe86c09cc
@ -62,6 +62,15 @@ pub struct VariableDeclarationStack
|
|||||||
|
|
||||||
impl VariableDeclarationStack
|
impl VariableDeclarationStack
|
||||||
{
|
{
|
||||||
|
pub fn new() -> Self
|
||||||
|
{
|
||||||
|
Self
|
||||||
|
{
|
||||||
|
free_variable_declarations: VariableDeclarations::new(),
|
||||||
|
bound_variable_declaration_stack: vec![],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn find(&self, variable_name: &str) -> Option<std::rc::Rc<VariableDeclaration>>
|
pub fn find(&self, variable_name: &str) -> Option<std::rc::Rc<VariableDeclaration>>
|
||||||
{
|
{
|
||||||
for variable_declarations in self.bound_variable_declaration_stack.iter().rev()
|
for variable_declarations in self.bound_variable_declaration_stack.iter().rev()
|
||||||
|
Loading…
Reference in New Issue
Block a user