aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2023-12-20 20:46:00 -0600
committerMarc Coquand <marc@mccd.space>2023-12-25 18:22:59 -0600
commit262f161f42c4e59beec41c6f440336c38385426a (patch)
tree6491c9b661a0b5a14c9a30ecf25e036f8762239d /bin
parentcc783c157f31e7e713c8b83be67449b1859dac27 (diff)
downloadfixgen-262f161f42c4e59beec41c6f440336c38385426a.tar.gz
fixgen-262f161f42c4e59beec41c6f440336c38385426a.tar.bz2
fixgen-262f161f42c4e59beec41c6f440336c38385426a.zip
Initial commit
Diffstat (limited to '')
-rw-r--r--bin/dune7
-rw-r--r--bin/main.ml33
2 files changed, 20 insertions, 20 deletions
diff --git a/bin/dune b/bin/dune
index 62d69ee..ce5ed03 100644
--- a/bin/dune
+++ b/bin/dune
@@ -1,5 +1,6 @@
(executable
- (public_name ann_bloop)
+ (public_name fixgen)
(name main)
- (libraries ann_bloop uri dream)
- (preprocess (pps lwt_ppx ppx_yojson_conv ppx_inline_test)))
+ (libraries
+ fixgen)
+ )
diff --git a/bin/main.ml b/bin/main.ml
index 2ed3595..6942382 100644
--- a/bin/main.ml
+++ b/bin/main.ml
@@ -1,19 +1,18 @@
-open Ann_bloop
+open Fixgen
+
+let parse (s : string) =
+ let lexbuf = Lexing.from_string s in
+ let ast = Parser.prog Lexer.read lexbuf in
+ ast
+
let () =
- let port =
- Sys.getenv_opt "PORT" |> Option.map int_of_string
- |> Option.value ~default:8080
- in
- let env = Sys.getenv_opt "ENV" |> Option.value ~default:"PROD" in
- let disable_auth =
- Sys.getenv_opt "DISABLE_AUTH" |> Option.value ~default:"false"
- in
- let interface = if env = "DEV" then "localhost" else "0.0.0.0" in
- Dream.run ~port ~interface @@ Dream.logger
- @@ Dream.router
- [
- Dream.get "/actor" (fun _ ->
- Dream.log "Sending actor";
- Dream.html "Hello world!")
- ]
+ let result = parse "user: id uuidv4, uh uuidv4\npurchases: id uuidv4, pid user.id" in
+ match result with
+ | Some ast ->
+ Ast_types.compile ast ~amount:4
+ |> List.iter (fun (name, file) ->
+ let result = Fixture.csv_of_generated_fixtures file in
+ print_endline ("FILE NAME: " ^ name);
+ print_endline result)
+ | None -> print_endline "error"