diff options
Diffstat (limited to 'lib/xixanta/src/context.rs')
| -rw-r--r-- | lib/xixanta/src/context.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/xixanta/src/context.rs b/lib/xixanta/src/context.rs index aade200..a4ffc5b 100644 --- a/lib/xixanta/src/context.rs +++ b/lib/xixanta/src/context.rs @@ -62,6 +62,15 @@ impl Context { self.map.entry(name).or_default(); } + pub fn push_stack(&mut self, identifier: &String) { + let name = match self.stack.last() { + Some(n) => n.to_owned() + &String::from("::") + identifier, + None => identifier.to_string(), + }; + + self.stack.push(name.clone()); + } + pub fn pop(&mut self) -> bool { if self.stack.is_empty() { return false; |
