diff --git a/src/protocol/ast.rs b/src/protocol/ast.rs index 6b2eaef1f425c59ef163f966967fb4a41daff97b..26c59a07ff48d4f95eb99cf4139b2ff262ed38cb 100644 --- a/src/protocol/ast.rs +++ b/src/protocol/ast.rs @@ -737,6 +737,22 @@ pub struct Scope { pub next_unique_id_in_scope: i32, } +impl Scope { + pub(crate) fn new(id: ScopeId, association: ScopeAssociation) -> Self { + return Self{ + this: id, + parent: None, + nested: Vec::new(), + association, + variables: Vec::new(), + labels: Vec::new(), + relative_pos_in_parent: -1, + first_unique_id_in_scope: -1, + next_unique_id_in_scope: -1, + } + } +} + impl Scope { pub(crate) fn new_invalid(this: ScopeId) -> Self { return Self{