From d96e1839eb800bf26bcc38272072d98af69f5d83 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Tue, 26 Dec 2023 10:08:23 -0600 Subject: Support const keyword --- 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 b9f4294..c278d59 100644 --- a/lib/ast_types.ml +++ b/lib/ast_types.ml @@ -5,6 +5,7 @@ type ast_row = | Uuidv4 of string * ast_row | Name of string * ast_row | Int of string * int * int * ast_row + | Const of string * string * ast_row | Foreign of string * string * string * ast_row (* parent, row, child_name, row *) | End @@ -19,6 +20,9 @@ let rec print_row = function | Uuidv4 (s, r) -> printf "UUIDv4(%s)," s; print_row r + | Const (s, v, r) -> + printf "Const(%s, %s)," s v; + print_row r | Foreign (p, r, c, next_row) -> printf "Foreign(%s.%s, %s)," p r c; print_row next_row @@ -60,6 +64,7 @@ let rec ast_row_to_fixtures = function 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 + | Const (s, v, r) -> PRow (Fixture.Const (s, v)) :: ast_row_to_fixtures r | End -> [] -- cgit v1.2.3