package utop

  1. Overview
  2. Docs
Universal toplevel for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

utop-2.14.0.tbz
sha256=0fd5a9bc5b458524a71463a1fe0cd16f9b7be13673ae303118b7216e0d273ba9
sha512=d64a5ab671424279be13ebd080deac7ee46e2c9bc3abcfc37a6dff164124cc3abc52801527c35d9160ec868f9b8f334880026aaeaad02e507112fd8392094845

doc/utop/UTop_token/index.html

Module UTop_tokenSource

Tokens.

The type of tokens is semi-structured: parentheses construct and quotations are nested and others tokens are flat list.

Sourcetype location = {
  1. idx1 : int;
    (*

    Start position in unicode characters.

    *)
  2. idx2 : int;
    (*

    Stop position in unicode characters.

    *)
  3. ofs1 : int;
    (*

    Start position in bytes.

    *)
  4. ofs2 : int;
    (*

    Stop position in bytes.

    *)
}

Locations in the source string, which is encoded in UTF-8.

Sourcetype t =
  1. | Symbol of string
  2. | Lident of string
  3. | Uident of string
  4. | Constant of string
  5. | Char
  6. | String of int * bool
    (*

    String (quote_size, terminated).

    *)
  7. | Comment of comment_kind * bool
    (*

    Comment (kind, terminated).

    *)
  8. | Blanks
  9. | Error
  10. | Quotation of (quotation_item * location) list * bool
    (*

    Quotation (items, terminated).

    *)
Sourceand comment_kind =
  1. | Comment_reg
    (*

    Regular comment.

    *)
  2. | Comment_doc
    (*

    Documentation comment.

    *)
Sourceand quotation_item =
  1. | Quot_data
  2. | Quot_anti of antiquotation
Sourceand antiquotation = {
  1. a_opening : location;
    (*

    Location of the opening $.

    *)
  2. a_closing : location option;
    (*

    Location of the closing $.

    *)
  3. a_name : (location * location) option;
    (*

    Location of the name and colon if any.

    *)
  4. a_contents : (t * location) list;
    (*

    Contents of the location.

    *)
}