forked from extern/nushell
Add stepping to ranges & enable reverse ranges
Follows the following syntax: <start>..<next-value>..<end>
This commit is contained in:
@ -85,15 +85,19 @@ pub fn flatten_expression(
|
||||
}
|
||||
output
|
||||
}
|
||||
Expr::Range(from, to, op) => {
|
||||
Expr::Range(from, next, to, op) => {
|
||||
let mut output = vec![];
|
||||
if let Some(f) = from {
|
||||
output.extend(flatten_expression(working_set, f));
|
||||
}
|
||||
if let Some(s) = next {
|
||||
output.extend(vec![(op.next_op_span, FlatShape::Operator)]);
|
||||
output.extend(flatten_expression(working_set, s));
|
||||
}
|
||||
output.extend(vec![(op.span, FlatShape::Operator)]);
|
||||
if let Some(t) = to {
|
||||
output.extend(flatten_expression(working_set, t));
|
||||
}
|
||||
output.extend(vec![(op.span, FlatShape::Operator)]);
|
||||
output
|
||||
}
|
||||
Expr::Bool(_) => {
|
||||
|
Reference in New Issue
Block a user