package orsetto
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=9b654edb663ae697563f150824047052f3b1bf760398f24bce6350553f031f73c46b6337239a1acd871e61238597ea92046809e3358290ff14d6ba671b449085
doc/orsetto.ucs/Ucs_scan/UTF8/Annot/index.html
Module UTF8.Annot
The annotation system for Unicode encoded texts.
Include the common signature specialized for textual positions.
The following table explains the field categories for structural metadata interchange:
`Serial: the.serialfield.`Stream: the.streamfield.`Offsets: the.octetsand.lnadjfields.`Lines: the.numberand.columnfields.
include Cf_annot.Profile
with type position := Cf_annot.Textual.position
and type Meta.fields = [ `Serial | `Stream | `Offsets | `Lines ]
with type symbol := Uchar.t
The type of an input event, comprising a symbol and its position.
type span = private | Span of {start : Cf_annot.Textual.position;limit : Cf_annot.Textual.position;
}
Representation of a span of positions, comprising the pair of a) the position of the first symbol in the span, and b) the position of the symbol immediately following the last symbol in the span. Accordingly, if both the start and limit fields have the same serial number, then the span is empty, comprising no symbols.
A value annotated with its span of text in the input stream.
module Scan_basis :
Cf_scan.Basis
with type Symbol.t = Uchar.t
and type iota = iota
and type position = Cf_annot.Textual.position
and type 'a Form.t = 'a formA basis module for constructing a
Inclusion of the
f_scan
production form signature.
include Cf_scan.Form with type 'a t := 'a form
val imp : 'a -> 'a formScanners use imp value to create a value form with a distinguished implicit position, i.e. not located in the input stream.
val dn : 'a form -> 'aScanners use dn form to get the value wrapped in form.
Scanners use mv value form to make a form containing value attributed with the same position as form.
Use up v to lift v into a form. Use the optional ~span argument to specify an explicit span of locations. Otherwise, this function is equivalent to imp v.
Use map f v to apply f to the value enclosed in v to make the result annotated with the same position as v.
Use join f a b to apply f to the values enclosed in a and b to make the result annotated with the span that covers the overlap of the positions of both a and b.
Use collect s to collect all the values enclosed in the forms s to a single list annotated with the span that overlaps all the positions in s.
val to_iotas : ?start:Cf_annot.Textual.position -> Uchar.t Seq.t -> iota Seq.tUse to_iotas s to lift s into a sequence of iota values. Use ~start to provide an explicit starting position.
module Meta : sig ... endA submodule to facilitate structural interchange of metadata.
val emit_form : Format.formatter -> 'a form -> unitUse emit_form pp vl to print the span of vl with pp in a mostly readable format.