package fmlib_parse

  1. Overview
  2. Docs
Parsing with combinators and indentation sensitivity

Install

Dune Dependency

Authors

Maintainers

Sources

0.5.9.tar.gz
sha256=9efb96fe5c1cfb4edc2ff5c6df4537ce9ded12175a60021e9d482e51eb69ebfb
md5=3fb18b650cfcb0bf3bd05e120e17b28f

doc/fmlib_parse/Fmlib_parse/Utf8/Decoder/index.html

Module Utf8.Decoder

A character decoder has some valid initial value init. In order to decode a character bytes has to be pushed into the decoder by put until the decoder is either complete (is_complete) or has encoutered some decoding error (has_error).

If the decoding is complete the decoded unicode character is returned by uchar. As long as the scan is not complete or if the scan has encountered some decoding error the function uchar returns rep = U+FFFD.

type t

Partially or completely scanned unicode character.

val is_complete : t -> bool

Has the unicode character been completely scanned?

val has_error : t -> bool

Has the scanning of the unicode character encountered an encoding error?

val uchar : t -> Uchar.t

The unicode character. In case of an error or a not yet completed scan, the unicode character rep = U+FFFD is returned.

val scalar : t -> int

The scalar value of the unicode character.

val width : t -> int

The visible width of the unicode character.

val byte_width : t -> int

Number of bytes used during decoding.

val is_newline : t -> bool

Is the decoded character a newline character?

val init : t

Initial value representing the completely scanned unicode character U+0000.

The following assertions are valid:

  • is_complete init
  • not (has_error init)
val put : char -> t -> t

put byte dec Feed the scanner with the next byte of the encoded unicode character.

OCaml

Innovation. Community. Security.