this repo has no description
at main 106 lines 2.5 kB view raw
1(** Typed names for paths, identifiers, references and fragments. 2 3 This module contains a module per type of named object in our internal 4 representation of the langage, each containing an opaque type [t]. This 5 allows us to ensure that, for example, we never mistake a module name for a 6 module type name. *) 7 8val parenthesise : string -> string 9val contains_double_underscore : string -> bool 10(* not the best place for this but. *) 11 12val set_unique_ident : string -> unit 13 14(** Name is the signature for names that could possibly be hidden. Hidden names 15 occur when we generate items that don't have a path that will be exposed in 16 the generated HTML. This can occur for a few reasons: 17 18 1. explicitly hidden by the user with stop comments 2. generalised opens 3. 19 shadowed identifiers 20 21 In cases 1 and 2 the identifiers are available for use later in the 22 signature (or more generally) whereas for case 3 they aren't, and it's 23 helpful to keep this distinction. *) 24 25module type Name = sig 26 type t 27 28 val to_string : t -> string 29 30 val to_string_unsafe : t -> string 31 32 val make_std : string -> t 33 34 val of_ident : Ident.t -> t 35 36 val hidden_of_string : string -> t 37 38 val hidden_of_ident : Ident.t -> t 39 40 val shadowed_of_string : string -> t 41 42 val shadowed_of_ident : Ident.t -> t 43 44 val equal_modulo_shadowing : t -> t -> bool 45 46 val equal : t -> t -> bool 47 48 val compare : t -> t -> int 49 50 val fmt : Format.formatter -> t -> unit 51 52 (* Returns true for any sort of hidden identifier - explicitly hidden or shadowed *) 53 val is_hidden : t -> bool 54end 55 56(** Some named objects can't have internal names, so they have this simpler 57 module. *) 58module type SimpleName = sig 59 type t 60 61 val to_string : t -> string 62 63 val make_std : string -> t 64 65 val of_ident : Ident.t -> t 66 67 val equal : t -> t -> bool 68 69 val compare : t -> t -> int 70 71 val fmt : Format.formatter -> t -> unit 72 73 val is_hidden : t -> bool 74end 75 76module ModuleName : Name 77 78module ModuleTypeName : Name 79 80module TypeName : Name 81 82module ConstructorName : SimpleName 83 84module FieldName : SimpleName 85 86module UnboxedFieldName : SimpleName 87 88module ExtensionName : SimpleName 89 90module ExceptionName : SimpleName 91 92module ValueName : Name 93 94module MethodName : SimpleName 95 96module InstanceVariableName : SimpleName 97 98module LabelName : SimpleName 99 100module PageName : SimpleName 101 102module DefName : SimpleName 103 104module LocalName : SimpleName 105 106module AssetName : SimpleName