fix compile error in make-text-builder.sml

This commit is contained in:
2025-08-17 17:30:51 +01:00
parent 3e67d90512
commit 845605aa48

View File

@@ -1,12 +1,16 @@
structure PosData =
struct
(* I don't like introducing new bindings in the global name space
* so the pos_data type is introduced in a new struct. *)
type t = {chr: char, strIdx: int, absIdx: int, hd: string, tl: string list}
end
signature MAKE_TEXT_BUILDER =
sig
type state
type env
type pos_data =
{chr: char, strIdx: int, absIdx: int, hd: string, tl: string list}
val folder: pos_data * env * state -> state
val folder: PosData.t * env * state -> state
val stopFold: state -> bool
end
@@ -29,3 +33,14 @@ struct
buildLoop (strIdx + 1, absIdx + 1, hd, tl, env, state)
end
end
structure Good =
MakeTextBuilder
(struct
type state = unit
type env = unit
fun folder (_, _, _) = ()
fun stopFold () = false
fun finish () = 33
end)