7.11. RST labels and short type names

The RST_LABEL module spells the RST label of a function and the short type names that label hashes. It is the leaf both rst and the rst_comment reader share: the reader is a parser macro, and every module parsed before it registers loses its //! comments, so this module requires only builtin modules and its reference pages are written by hand.

All functions and symbols are in “rst_label” module, use require to get access to it.

require daslib/rst_label

7.11.1. Label makers

7.11.1.1. function_label_file

function_label_file(name: auto; value: TypeDecl?; drop_args: int = 0 ): auto

Creates a unique, file-name-safe label string for a function: its safe name and a hash of its argument types.

Arguments:
  • name : auto

  • value : TypeDecl?&

  • drop_args : int

function_label_file(value: Function?; drop_args: int = 0 ): string

safe_function_name(name: string ): string

Escapes special characters in a function name to produce a safe identifier for RST output.

Arguments:
  • name : string

7.11.2. Short type names

cleanup_type_short(name: string ): string

Drops the const, ref, implicit and temporary suffixes describe spells, keeping the # and [] marks.

Arguments:
  • name : string implicit

describe_type_short(td: TypeDecl? ): string

Spells a type the way the reference manual does: aliases by name, containers and callables structurally, everything else through describe with its qualifiers dropped.

Arguments: