Date literals (#4619)

* Date literals

* update deps

* Add date+duration
This commit is contained in:
JT
2022-02-23 21:02:48 -05:00
committed by GitHub
parent 63487941fb
commit 4b18fdcc6e
19 changed files with 201 additions and 23 deletions

View File

@ -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),

View File

@ -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 {