From ec0606091bdcc8a8473ba909fb8ca2d873ce4a59 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 30 Sep 2024 13:55:55 -0400 Subject: Add datetime literal and tests --- compile.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compile.c') diff --git a/compile.c b/compile.c index f1c27328..744ac95f 100644 --- a/compile.c +++ b/compile.c @@ -1850,6 +1850,10 @@ CORD compile(env_t *env, ast_t *ast) return compile_null(t); } case Bool: return Match(ast, Bool)->b ? "yes" : "no"; + case DateTime: { + auto dt = Match(ast, DateTime)->dt; + return CORD_asprintf("((DateTime_t){.tv_sec=%ld, .tv_usec=%ld})", dt.tv_sec, dt.tv_usec); + } case Var: { binding_t *b = get_binding(env, Match(ast, Var)->name); if (b) -- cgit v1.2.3