aboutsummaryrefslogtreecommitdiff
path: root/lib/ast_types.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2023-12-26 09:34:58 -0600
committerMarc Coquand <marc@mccd.space>2023-12-26 09:57:20 -0600
commit742c23d7c5d90b681dcbce92846d57042d2ea467 (patch)
treeb6cf10333e15bc7b748744f7c7af805ca77f222c /lib/ast_types.ml
parent8ac0e27adc8d14a77427351dede1757999c8c709 (diff)
downloadfixgen-742c23d7c5d90b681dcbce92846d57042d2ea467.tar.gz
fixgen-742c23d7c5d90b681dcbce92846d57042d2ea467.tar.bz2
fixgen-742c23d7c5d90b681dcbce92846d57042d2ea467.zip
Add support for ints
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 1c5de60..7b4f445 100644
--- a/lib/ast_types.ml
+++ b/lib/ast_types.ml
@@ -4,6 +4,7 @@ module Fixture = Fixture
type ast_row =
| Uuidv4 of string * ast_row
| Name of string * ast_row
+ | Int of string * int * int * ast_row
| Foreign of string * string * string * ast_row
(* parent, row, child_name, row *)
| End
@@ -21,6 +22,9 @@ let rec print_row = function
| Foreign (p, r, c, next_row) ->
printf "Foreign(%s.%s, %s)," p r c;
print_row next_row
+ | Int (s, min, max, r) ->
+ printf "Int(%s, %d, %d)," s min max;
+ print_row r
| Name (s, r) ->
printf "Name(%s)," s;
print_row r
@@ -55,6 +59,7 @@ let rec ast_row_to_fixtures = function
| Foreign (p, r, c, next_row) ->
CRow (p, r, fun l -> Fixture.Foreign (c, l)) :: ast_row_to_fixtures next_row
| Name (s, r) -> PRow (Fixture.Name s) :: ast_row_to_fixtures r
+ | Int (s, min, max, r) -> PRow (Fixture.Int (s, min, max)) :: ast_row_to_fixtures r
| End -> []