package ocaml-solo5-cross-aarch64

  1. Overview
  2. Docs
OCaml cross-compiler to the freestanding 64-bit ARM Solo5 backend

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v1.2.0.tar.gz
md5=4d07934aea2d32b77ba1b8bb062c6594
sha512=2ec008da088f7998d024b790679605813f1954de36b999031db0b003706e67f3f13554e93fa07be00f26633ea27c2b2f9f987e8b08f85c63f956bfbc306bd620

doc/compiler-libs.common/Misc/Utf8_lexeme/index.html

Module Misc.Utf8_lexeme

type t = string
val normalize : string -> (t, t) Result.t

Normalize the given UTF-8 encoded string. Invalid UTF-8 sequences results in a error and are replaced by U+FFFD. Identifier characters are put in NFC normalized form. Other Unicode characters are left unchanged.

val capitalize : string -> (t, t) Result.t

Like normalize, but if the string starts with a lowercase identifier character, it is replaced by the corresponding uppercase character. Subsequent characters are not changed.

val uncapitalize : string -> (t, t) Result.t

Like normalize, but if the string starts with an uppercase identifier character, it is replaced by the corresponding lowercase character. Subsequent characters are not changed.

val is_capitalized : t -> bool

Returns true if the given normalized string starts with an uppercase identifier character, false otherwise. May return wrong results if the string is not normalized.

val is_valid_identifier : t -> bool

Check whether the given normalized string is a valid OCaml identifier:

  • all characters are identifier characters
  • it does not start with a digit or a single quote
val is_lowercase : t -> bool

Returns true if the given normalized string only contains lowercase identifier character, false otherwise. May return wrong results if the string is not normalized.

type validation_result =
  1. | Valid
  2. | Invalid_character of Uchar.t
    (*

    Character not allowed

    *)
  3. | Invalid_beginning of Uchar.t
    (*

    Character not allowed as first char

    *)
val validate_identifier : ?with_dot:bool -> t -> validation_result

Like is_valid_identifier, but returns a more detailed error code. Dots can be allowed to extend support to path-like identifiers.

val starts_like_a_valid_identifier : t -> bool

Checks whether the given normalized string starts with an identifier character other than a digit or a single quote. Subsequent characters are not checked.