Pipeline blocks (#1579)

* Making Commands match what UntaggedValue needs

* WIP

* WIP

* WIP

* Moved to expressions for conditions

* Add 'each' command to use command blocks

* More cleanup

* Add test for 'each'

* Instead use an expression block
This commit is contained in:
Jonathan Turner
2020-04-13 19:59:57 +12:00
committed by GitHub
parent 85d6b24be3
commit 08a09e2273
40 changed files with 544 additions and 444 deletions

View File

@ -13,7 +13,7 @@ use std::ops::Range;
/// A structured reason for a ParseError. Note that parsing in nu is more like macro expansion in
/// other languages, so the kinds of errors that can occur during parsing are more contextual than
/// you might expect.
#[derive(Debug, Clone, Eq, PartialEq)]
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)]
pub enum ParseErrorReason {
/// The parser encountered an EOF rather than what it was expecting
Eof { expected: String, span: Span },
@ -38,7 +38,7 @@ pub enum ParseErrorReason {
}
/// A newtype for `ParseErrorReason`
#[derive(Debug, Clone, Eq, PartialEq, Getters)]
#[derive(Debug, Clone, Getters, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)]
pub struct ParseError {
#[get = "pub"]
reason: ParseErrorReason,