mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 14:48:44 +02:00
Block params
This commit is contained in:
@ -13,7 +13,7 @@ pub struct EngineState {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct ScopeFrame {
|
||||
pub struct ScopeFrame {
|
||||
vars: HashMap<Vec<u8>, VarId>,
|
||||
decls: HashMap<Vec<u8>, DeclId>,
|
||||
aliases: HashMap<Vec<u8>, Vec<Span>>,
|
||||
@ -27,6 +27,16 @@ impl ScopeFrame {
|
||||
aliases: HashMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_var(&self, var_name: &[u8]) -> Option<&VarId> {
|
||||
self.vars.get(var_name)
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ScopeFrame {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for EngineState {
|
||||
@ -188,7 +198,7 @@ pub struct StateDelta {
|
||||
vars: Vec<Type>, // indexed by VarId
|
||||
decls: Vec<Box<dyn Command>>, // indexed by DeclId
|
||||
blocks: Vec<Block>, // indexed by BlockId
|
||||
scope: Vec<ScopeFrame>,
|
||||
pub scope: Vec<ScopeFrame>,
|
||||
}
|
||||
|
||||
impl StateDelta {
|
||||
|
Reference in New Issue
Block a user