diff --git a/core/src/syn/parser/builtin.rs b/core/src/syn/parser/builtin.rs index c2f0c63c..4ed33f71 100644 --- a/core/src/syn/parser/builtin.rs +++ b/core/src/syn/parser/builtin.rs @@ -458,6 +458,7 @@ pub(crate) static PATHS: phf::Map, PathKind> = phf_map! { UniCase::ascii("math::PI") => PathKind::Constant(Constant::MathPi), UniCase::ascii("math::SQRT_2") => PathKind::Constant(Constant::MathSqrt2), UniCase::ascii("math::TAU") => PathKind::Constant(Constant::MathTau), + UniCase::ascii("time::EPOCH") => PathKind::Constant(Constant::TimeEpoch) }; impl Parser<'_> { diff --git a/core/src/syn/parser/test/value.rs b/core/src/syn/parser/test/value.rs index 86837edc..5efb494a 100644 --- a/core/src/syn/parser/test/value.rs +++ b/core/src/syn/parser/test/value.rs @@ -144,6 +144,9 @@ fn constant_lowercase() { let out = test_parse!(parse_value_table, r#" math::neg_inf "#).unwrap(); assert_eq!(out, Value::Constant(Constant::MathNegInf)); + + let out = test_parse!(parse_value_table, r#" time::epoch "#).unwrap(); + assert_eq!(out, Value::Constant(Constant::TimeEpoch)); } #[test] @@ -156,6 +159,9 @@ fn constant_uppercase() { let out = test_parse!(parse_value_table, r#" MATH::NEG_INF "#).unwrap(); assert_eq!(out, Value::Constant(Constant::MathNegInf)); + + let out = test_parse!(parse_value_table, r#" TIME::EPOCH "#).unwrap(); + assert_eq!(out, Value::Constant(Constant::TimeEpoch)); } #[test] @@ -168,6 +174,9 @@ fn constant_mixedcase() { let out = test_parse!(parse_value_table, r#" MaTh::Neg_Inf "#).unwrap(); assert_eq!(out, Value::Constant(Constant::MathNegInf)); + + let out = test_parse!(parse_value_table, r#" TiME::ePoCH "#).unwrap(); + assert_eq!(out, Value::Constant(Constant::TimeEpoch)); } #[test]