diff options
author | Marc Coquand <marc@mccd.space> | 2024-01-12 08:01:25 -0600 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2024-01-12 08:01:25 -0600 |
commit | 20c5abba2f762e917503e3d613729f12607baf88 (patch) | |
tree | ab9eb3b897c60949483ea2db12c8f7ff382d7391 /lib/ast_types.ml | |
parent | 014feebff76f5bb5e711a3897ed930d8e4f009c1 (diff) | |
download | fixgen-20c5abba2f762e917503e3d613729f12607baf88.tar.gz fixgen-20c5abba2f762e917503e3d613729f12607baf88.tar.bz2 fixgen-20c5abba2f762e917503e3d613729f12607baf88.zip |
Implement support for dates
Diffstat (limited to 'lib/ast_types.ml')
-rw-r--r-- | lib/ast_types.ml | 15 |
1 files changed, 15 insertions, 0 deletions
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 = |