planck / lib / ptoken.mli

module Make(Stream : Stoken.S) : sig
  include Pbase.S with type Str.desc   = Stream.desc
                  and  type Str.Elem.t = Stream.Elem.t
                  and  type Str.Pos.t  = Stream.Pos.t
                  and  type Str.Attr.t = Stream.Attr.t

  val last_position : Stream.Pos.t t

  val with_region 
    : ([ `Between of Stream.Pos.t * Stream.Pos.t
       | `EndOf of Stream.Pos.t ] -> Stream.Pos.t) (** Position merger *)
    -> 'a t 
    -> ('a * Stream.Pos.t) t
    (** The position merger should calculate [Stream.Pos.t] of the following specification:
        [`Between (p1, p2)] : a position starts at the start point of [p1] and ends at the end point of [p2]
        [`EndOf p] : a position starts and ends at the end point of [p] 

        See [Position.Region.merge] for an example.