|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
use nu_protocol::{
|
|
|
|
|
ast::Block,
|
|
|
|
|
engine::{EngineState, StateWorkingSet},
|
|
|
|
|
PipelineData, Span,
|
|
|
|
|
Span,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
use crate::error::{CrateError, CrateResult};
|
|
|
|
@ -17,13 +17,6 @@ impl NewEmpty for Span {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl NewEmpty for PipelineData {
|
|
|
|
|
#[inline]
|
|
|
|
|
fn empty() -> Self {
|
|
|
|
|
Self::new(Span::empty())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn parse_nu_script(engine_state: &mut EngineState, contents: String) -> CrateResult<Block> {
|
|
|
|
|
let mut working_set = StateWorkingSet::new(&engine_state);
|
|
|
|
|
let (block, err) = nu_parser::parse(&mut working_set, None, &contents.into_bytes(), false, &[]);
|
|
|
|
|