Move from using a Block to an Arc'd Block (#3289)

This commit is contained in:
Jonathan Turner
2021-04-09 20:12:25 +12:00
committed by GitHub
parent ac070ae942
commit b791d1ab0d
11 changed files with 81 additions and 54 deletions

View File

@ -1,15 +1,15 @@
use nu_protocol::hir::Block;
use nu_source::Spanned;
use std::fmt::Debug;
use std::{fmt::Debug, sync::Arc};
pub trait ParserScope: Debug {
fn get_signature(&self, name: &str) -> Option<nu_protocol::Signature>;
fn has_signature(&self, name: &str) -> bool;
fn add_definition(&self, block: Block);
fn add_definition(&self, block: Arc<Block>);
fn get_definitions(&self) -> Vec<Block>;
fn get_definitions(&self) -> Vec<Arc<Block>>;
fn get_alias(&self, name: &str) -> Option<Vec<Spanned<String>>>;