package dolmen

  1. Overview
  2. Docs
Module type
Class type

Escaping identifiers

This module provides helpers to print identifers in languages, in order to ensure that the printed string is conform to a language specification, in order to avoid all kinds of injections (e.g. parentheses in identifier names, etc...)

Identifier name manipulation

val smap : (int -> char -> string) -> string -> string

umap f provides an equivalent of flat_map on strings. f is given the position of the character in the string (starting from 1), and a character.

val rename : sep:char -> string -> string

A renaming function, which add an increasing number after the given separator.

Identifier escaping

module type Arg = Dolmen_intf.Id.Escape
module Make (Id : Arg) : sig ... end