mirror of
https://github.com/nushell/nushell.git
synced 2025-08-18 10:49:45 +02:00
Math operators (#1601)
* Add some math operations * WIP for adding compound expressions * precedence parsing * paren expressions * better lhs handling * add compound comparisons and shorthand lefthand parsing * Add or comparison and shorthand paths
This commit is contained in:
@@ -156,6 +156,12 @@ pub fn autoview(context: RunnableContext) -> Result<OutputStream, ShellError> {
|
||||
} => {
|
||||
out!("{}", n);
|
||||
}
|
||||
Value {
|
||||
value: UntaggedValue::Primitive(Primitive::Boolean(b)),
|
||||
..
|
||||
} => {
|
||||
out!("{}", b);
|
||||
}
|
||||
|
||||
Value { value: UntaggedValue::Primitive(Primitive::Binary(ref b)), .. } => {
|
||||
if let Some(binary) = binary {
|
||||
|
@@ -16,7 +16,7 @@ impl WholeStreamCommand for SkipWhile {
|
||||
Signature::build("skip-while")
|
||||
.required(
|
||||
"condition",
|
||||
SyntaxShape::Condition,
|
||||
SyntaxShape::Math,
|
||||
"the condition that must be met to continue skipping",
|
||||
)
|
||||
.filter()
|
||||
|
@@ -18,7 +18,7 @@ impl PerItemCommand for Where {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("where").required(
|
||||
"condition",
|
||||
SyntaxShape::Condition,
|
||||
SyntaxShape::Math,
|
||||
"the condition that must match",
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user