mirror of
https://github.com/nushell/nushell.git
synced 2025-08-11 00:33:42 +02:00
Date literals (#4619)
* Date literals * update deps * Add date+duration
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
use chrono::FixedOffset;
|
||||
|
||||
use super::{Call, CellPath, Expression, FullCellPath, Operator, RangeOperator};
|
||||
use crate::{ast::ImportPattern, BlockId, Signature, Span, Spanned, Unit, VarId};
|
||||
|
||||
@ -26,6 +28,7 @@ pub enum Expr {
|
||||
Record(Vec<(Expression, Expression)>),
|
||||
Keyword(Vec<u8>, Span, Box<Expression>),
|
||||
ValueWithUnit(Box<Expression>, Spanned<Unit>),
|
||||
DateTime(chrono::DateTime<FixedOffset>),
|
||||
Filepath(String),
|
||||
GlobPattern(String),
|
||||
String(String),
|
||||
|
@ -142,6 +142,7 @@ impl Expression {
|
||||
false
|
||||
}
|
||||
Expr::CellPath(_) => false,
|
||||
Expr::DateTime(_) => false,
|
||||
Expr::ExternalCall(head, args) => {
|
||||
if head.has_in_variable(working_set) {
|
||||
return true;
|
||||
@ -301,6 +302,7 @@ impl Expression {
|
||||
}
|
||||
}
|
||||
Expr::CellPath(_) => {}
|
||||
Expr::DateTime(_) => {}
|
||||
Expr::ExternalCall(head, args) => {
|
||||
head.replace_in_variable(working_set, new_var_id);
|
||||
for arg in args {
|
||||
@ -443,6 +445,7 @@ impl Expression {
|
||||
}
|
||||
}
|
||||
Expr::CellPath(_) => {}
|
||||
Expr::DateTime(_) => {}
|
||||
Expr::ExternalCall(head, args) => {
|
||||
head.replace_span(working_set, replaced, new_span);
|
||||
for arg in args {
|
||||
|
Reference in New Issue
Block a user