From 490ab998999e033e91929f63d2deae4900c90375 Mon Sep 17 00:00:00 2001 From: Scott Lawrence Date: Tue, 25 Jun 2024 23:33:59 -0700 Subject: Stub of using angstrom --- bin/dune | 3 +-- bin/main.ml | 14 ++++---------- dune-project | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/bin/dune b/bin/dune index edad4dc..3891864 100644 --- a/bin/dune +++ b/bin/dune @@ -1,5 +1,4 @@ (executable (public_name agate) (name main) - (libraries agate sedlex) - (preprocess (pps sedlex.ppx))) + (libraries agate angstrom)) diff --git a/bin/main.ml b/bin/main.ml index de7cd87..2472a93 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -1,11 +1,5 @@ -let rec token buf = - match%sedlex buf with - | white_space -> token buf - | "a" -> token buf - | "b" -> 2 - | eof -> 0 - | _ -> failwith "Unknown token" +open Angstrom -let () = - let lexbuf = Sedlexing.Utf8.from_string "ab" in - print_newline (print_int (token lexbuf)) +let parse (str:string) : unit = num str + +let () = parse "" diff --git a/dune-project b/dune-project index d636dc5..43392bf 100644 --- a/dune-project +++ b/dune-project @@ -19,7 +19,7 @@ (name agate) (synopsis "A strongly typed concatenative language") (description "A strongly typed concatenative language") - (depends ocaml dune sedlex) + (depends ocaml dune angstrom) (tags (topics "to describe" your project))) -- cgit v1.2.3-54-g00ecf