From 742c23d7c5d90b681dcbce92846d57042d2ea467 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Tue, 26 Dec 2023 09:34:58 -0600 Subject: Add support for ints --- lib/ast_types.ml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/ast_types.ml') 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 -> [] -- cgit v1.2.3