nushell/src/parser/parse/pipeline.rs
George Pollard 6034de641a
Improve parsing of pipelines, require pipes
At the moment the pipeline parser does not enforce
that there must be a pipe between each part of the pipeline,
which can lead to confusing behaviour or misleading errors.
2019-09-05 03:30:51 +12:00

19 lines
511 B
Rust

use crate::parser::CallNode;
use crate::{Span, Tagged};
use derive_new::new;
use getset::Getters;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, new)]
pub struct Pipeline {
pub(crate) parts: Vec<PipelineElement>,
pub(crate) post_ws: Option<Span>,
}
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Getters, new)]
pub struct PipelineElement {
pub pipe: Option<Span>,
pub pre_ws: Option<Span>,
#[get = "pub(crate)"]
call: Tagged<CallNode>,
pub post_ws: Option<Span>,
}