aboutsummaryrefslogtreecommitdiff
path: root/lib/ast_types.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2023-12-26 18:26:40 -0600
committerMarc Coquand <marc@mccd.space>2023-12-26 18:26:40 -0600
commit664b34059624d525d38da3e9e452a4bfc190a585 (patch)
treeef5558d350640e7ee206994559bbd1d87dad135d /lib/ast_types.ml
parent6c39f6ebc688c1ed751c08e7cc11016148cd3ce7 (diff)
downloadfixgen-664b34059624d525d38da3e9e452a4bfc190a585.tar.gz
fixgen-664b34059624d525d38da3e9e452a4bfc190a585.tar.bz2
fixgen-664b34059624d525d38da3e9e452a4bfc190a585.zip
Add support for username
Diffstat (limited to 'lib/ast_types.ml')
-rw-r--r--lib/ast_types.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ast_types.ml b/lib/ast_types.ml
index 0cbdb4f..0a4c05d 100644
--- a/lib/ast_types.ml
+++ b/lib/ast_types.ml
@@ -9,6 +9,7 @@ type ast_row =
| Email of string * ast_row
| Const of string * string * ast_row
| List of string * string list * ast_row
+ | Username of string * ast_row
| Foreign of string * string * string * ast_row
(* parent, row, child_name, row *)
| End
@@ -26,6 +27,9 @@ let rec print_row = function
| Uuidv4 (s, r) ->
printf "UUIDv4(%s)," s;
print_row r
+ | Username (s, r) ->
+ printf "User(%s)," s;
+ print_row r
| List (s, l, r) ->
printf "List(%s, %s)," s (String.concat ", " l);
print_row r
@@ -84,6 +88,7 @@ let rec ast_row_to_fixtures = function
| List (s, l, r) -> PColumn (Fixture.List (s, l)) :: ast_row_to_fixtures r
| 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
| End -> []
let extend_table_with_row table row =