summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Lawrence <scott+git@ineffectivetheory.com>2024-06-25 23:33:59 -0700
committerScott Lawrence <scott+git@ineffectivetheory.com>2024-06-25 23:33:59 -0700
commit490ab998999e033e91929f63d2deae4900c90375 (patch)
tree08ce565459a78073013d82e1a3bd61bfa179b0a1
parent062d3944ee86c273ad3919993185d5901768ef2d (diff)
downloadagate-490ab998999e033e91929f63d2deae4900c90375.tar.gz
agate-490ab998999e033e91929f63d2deae4900c90375.tar.bz2
agate-490ab998999e033e91929f63d2deae4900c90375.zip
Stub of using angstrom
-rw-r--r--bin/dune3
-rw-r--r--bin/main.ml14
-rw-r--r--dune-project2
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)))