about summary refs log tree commit diff
path: root/src/name
diff options
context:
space:
mode:
authorMalte Voos <git@mal.tc>2024-07-08 22:10:12 +0200
committerMalte Voos <git@mal.tc>2024-07-08 22:10:12 +0200
commit66cf5d3c5fff84a1cac333c1aa81a8e1f21ee6f4 (patch)
treebfbd237f12a3b973d0b93556e6235ced045db701 /src/name
parent97f84ccace4e634b4e02178a702818e69292dc9f (diff)
downloadtoytt-66cf5d3c5fff84a1cac333c1aa81a8e1f21ee6f4.tar.gz
toytt-66cf5d3c5fff84a1cac333c1aa81a8e1f21ee6f4.zip
rename Ident -> Name
Diffstat (limited to 'src/name')
-rw-r--r--src/name/Name.ml9
-rw-r--r--src/name/dune4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/name/Name.ml b/src/name/Name.ml
new file mode 100644
index 0000000..81c6575
--- /dev/null
+++ b/src/name/Name.ml
@@ -0,0 +1,9 @@
+type t = Yuujinchou.Trie.path
+
+type local = string option
+
+let to_local : t -> local option = function
+  | name :: [] -> Some (Some name)
+  | _ -> None
+
+let pp = Fmt.list ~sep:(Fmt.const Fmt.char '.') Fmt.string
diff --git a/src/name/dune b/src/name/dune
new file mode 100644
index 0000000..5a4e44c
--- /dev/null
+++ b/src/name/dune
@@ -0,0 +1,4 @@
+(library
+ (name Name)
+ (public_name toytt.name)
+ (libraries fmt yuujinchou))