diff options
Diffstat (limited to 'lib/xixanta/src/context.rs')
| -rw-r--r-- | lib/xixanta/src/context.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/xixanta/src/context.rs b/lib/xixanta/src/context.rs index 683d750..000c959 100644 --- a/lib/xixanta/src/context.rs +++ b/lib/xixanta/src/context.rs @@ -124,6 +124,8 @@ impl Context { let scope_name = self.name().to_string(); let scope = self.labels.get_mut(&scope_name).unwrap(); + // println!("PUSHING: {:#?}", bundle); + scope.push(bundle.clone()); } @@ -274,7 +276,7 @@ impl Context { Ok(()) } - // Returns the name of the current context. + /// Returns the name of the current context. pub fn name(&self) -> &str { match self.stack.last() { Some(name) => name, @@ -282,6 +284,11 @@ impl Context { } } + /// Returns true if we are in the global scope. + pub fn is_global(&self) -> bool { + self.stack.is_empty() + } + // Returns a human-readable string representing the current context. fn to_human(&self) -> String { match self.stack.last() { |
