From 20c5abba2f762e917503e3d613729f12607baf88 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Fri, 12 Jan 2024 08:01:25 -0600 Subject: Implement support for dates --- lib/ast_types.ml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/ast_types.ml') diff --git a/lib/ast_types.ml b/lib/ast_types.ml index 0a4c05d..95baea5 100644 --- a/lib/ast_types.ml +++ b/lib/ast_types.ml @@ -11,6 +11,9 @@ type ast_row = | List of string * string list * ast_row | Username of string * ast_row | Foreign of string * string * string * ast_row + | Past of string * ast_row + | Future of string * ast_row + | Now of string * ast_row (* parent, row, child_name, row *) | End [@@deriving show, eq] @@ -51,6 +54,15 @@ let rec print_row = function | Email (s, r) -> printf "Email(%s)," s; print_row r + | Past (s, r) -> + printf "Past(%s)," s; + print_row r + | Future (s, r) -> + printf "Future(%s)," s; + print_row r + | Now (s, r) -> + printf "Now(%s)," s; + print_row r | End -> printf "\n" @@ -89,6 +101,9 @@ let rec ast_row_to_fixtures = function | Increment (s, r) -> PColumn (Fixture.Increment s) :: ast_row_to_fixtures r | Email (s, r) -> PColumn (Fixture.Email s) :: ast_row_to_fixtures r | Username (s, r) -> PColumn (Fixture.Username s) :: ast_row_to_fixtures r + | Past (s, r) -> PColumn (Fixture.Past s) :: ast_row_to_fixtures r + | Future (s, r) -> PColumn (Fixture.Future s) :: ast_row_to_fixtures r + | Now (s, r) -> PColumn (Fixture.Now s) :: ast_row_to_fixtures r | End -> [] let extend_table_with_row table row = -- cgit v1.2.3