nushell/crates/nu-parser/src/scope.rs
Jonathan Turner ac578b8491
Multiline scripts part 2 (#2795)
* Begin allowing comments and multiline scripts.

* clippy

* Finish moving to groups. Test pass

* Keep going

* WIP

* WIP

* BROKEN WIP

* WIP

* WIP

* Fix more tests

* WIP: alias starts working

* Broken WIP

* Broken WIP

* Variables begin to work

* captures start working

* A little better but needs fixed scope

* Shorthand env setting

* Update main merge

* Broken WIP

* WIP

* custom command parsing

* Custom commands start working

* Fix coloring and parsing of block

* Almost there

* Add some tests

* Add more param types

* Bump version

* Fix benchmark

* Fix stuff
2020-12-18 20:53:49 +13:00

21 lines
522 B
Rust

use nu_protocol::hir::Block;
use nu_source::Spanned;
use std::fmt::Debug;
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 get_definitions(&self) -> Vec<Block>;
fn get_alias(&self, name: &str) -> Option<Vec<Spanned<String>>>;
fn add_alias(&self, name: &str, replacement: Vec<Spanned<String>>);
fn enter_scope(&self);
fn exit_scope(&self);
}