From: Michael D. Lowis Date: Tue, 7 Nov 2017 03:56:28 +0000 (-0500) Subject: sketched out cursor inerface a bit more X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c560e60ceef65a14081e678c34e2726cfb656ead;p=archive%2Ftide-ocaml.git sketched out cursor inerface a bit more --- diff --git a/docs/Buf.Cursor.html b/docs/Buf.Cursor.html index 0123ebb..eba0995 100644 --- a/docs/Buf.Cursor.html +++ b/docs/Buf.Cursor.html @@ -49,6 +49,7 @@
val make : Buf.buf -> int -> csr
val goto : Buf.buf -> csr -> int -> unit
+
val getc : Buf.buf -> csr -> Rope.rune
val nextc : Buf.buf -> csr -> unit
val prevc : Buf.buf -> csr -> unit
val nextln : Buf.buf -> csr -> unit
diff --git a/docs/index_values.html b/docs/index_values.html index 5748025..4ad4994 100644 --- a/docs/index_values.html +++ b/docs/index_values.html @@ -127,6 +127,8 @@ getb [Rope] +getc [Buf.Cursor] + getc [Rope] gets [Rope] diff --git a/docs/type_Buf.Cursor.html b/docs/type_Buf.Cursor.html index ca872d5..0c8a7e4 100644 --- a/docs/type_Buf.Cursor.html +++ b/docs/type_Buf.Cursor.html @@ -21,6 +21,7 @@   type t = Buf.Cursor.csr
  val make : Buf.buf -> int -> Buf.Cursor.csr
  val goto : Buf.buf -> Buf.Cursor.csr -> int -> unit
+  val getc : Buf.buf -> Buf.Cursor.csr -> Rope.rune
  val nextc : Buf.buf -> Buf.Cursor.csr -> unit
  val prevc : Buf.buf -> Buf.Cursor.csr -> unit
  val nextln : Buf.buf -> Buf.Cursor.csr -> unit
diff --git a/lib/buf.ml b/lib/buf.ml index f2e6c7b..fc71ccd 100644 --- a/lib/buf.ml +++ b/lib/buf.ml @@ -2,6 +2,7 @@ type buf = { path : string; rope : Rope.t } + type t = buf let empty = @@ -10,7 +11,7 @@ let empty = let load path = { path = path; rope = Rope.from_string (Misc.load_file path) } -let rope buf = +let rope buf = (* DELETEME *) buf.rope let iter_from fn buf i = diff --git a/lib/buf.mli b/lib/buf.mli index 6562edf..0aa7f06 100644 --- a/lib/buf.mli +++ b/lib/buf.mli @@ -11,6 +11,11 @@ module Cursor : sig val make : buf -> int -> t val goto : buf -> t -> int -> unit val getc : buf -> t -> int + (* + val putc : buf -> t -> int -> unit + val gets : buf -> t -> string + val puts : buf -> t -> string -> unit + *) val nextc : buf -> t -> unit val prevc : buf -> t -> unit val nextln : buf -> t -> unit